3

I joined some fields to my tables and now I need a tool or something to change that field's name.

How can I do this in ModelBuilder?

I didn't find any tool to do that.

  • possible duplicate of Renaming field using ArcPy? – Farid Cheraghi Jun 25 '15 at 14:34
  • This question is asking for ModelBuilder answers so I don't think it is a duplicate of the Q&A suggested above. However, I think it should be updated to specify what version is being used (there is a tag for 10.0 so it is probably that) and also the data type (10.2.1 and later solutions may be different for shapefiles and geodatabases). – PolyGeo Jun 29 '15 at 2:06
7

You cannot rename fields in an attribute table. However, you can add a new field and copy the values from the old field to the new one. Finally, delete the old field if you wish. In sum:

  1. Add Field
  2. Calculate Field
  3. Delete Field (optional)

enter image description here

  • Everytime I join a new field to the table this Calculate Field tool will substitute the values that it will use to fill the field created by Add Field? – AndM Jul 1 '15 at 9:37
5

Feature Class to Feature Class would be your answer. Particularly Field Mapping part is what you are after. If you look at the example below, names of the three fields on the left table are altered to new ones with this tool. enter image description here

One last note, if you have many fields to rename, this approach could be advantageous over the answer in terms of processing speed (it only takes as long as copy feature class operation), even though this approach may look complicated at first to some. In any case it involves manual editing/entering of each field in model builder either one by one or in bulk...

  • +1 This has the added benefit of creating a copy of the original dataset. – Aaron Jun 25 '15 at 13:45
  • This is the approach I would go, however, there is no option to change respectively set the field's alias. – Thomas Zuberbühler Jul 4 at 18:32
3

Another solution that is in concert with Aaron's solution,

arcpy.AlterField_management(r'C:\Data\Garbo.gdb\Khyber', 'oldfieldname', 'newfieldname', 'ALIAS') is the easiest way to achieve this.

There is the equivalent geoprocessing tool named "Alter Field" to be used in Model Builder.

This tool is available starting with 10.2.1

Before running the model make sure to close it in other application (e.g. ArcCatalog)

  • 2
    To complement this answer is should be stated this tool works only with geodatabase featureclasses. The original poster did not state what format their data was stored as. – Hornbydd Jun 25 '15 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.