Select to view content in your preferred language

'setnewalias' method for fieldInfo objects

08-01-2014 06:35 AM
Status: Closed
Labels (1)
Regular Contributor
fieldInfo objects are pretty neat but it seems to me they are missing a pretty important method. Currently, you can get field names, assign new names, set visibility, establish split policy, remove fields and return a list of the visible. I noticed you can't set a new field alias though. 

If you can set a new name using the setnewname() method, you should also be able to set a new alias using a setnewalias() method. I mean, names and alias' go hand-in-hand. 

Without this method, the only alternative to do this in python is to iterate through the fields after export and use the AlterFields tool.
1 Comment
Status changed to: Closed

Thank you for your idea! Broadly speaking, the FieldInfo object isn't as heavily used as some other approaches to achieve this goal. We recommend using arcpy.AlterAliasName on the resulting dataset in order to make the requested change.  This is not as elegant as your suggestion, but it should be effective.