Add field alias if field already exists

654
4
06-02-2011 12:29 PM
AnthonyFarndon
Occasional Contributor
Is it possible to add/amend  field alias if field already exists i.e. not going the AddField_management() route?
Tags (2)
0 Kudos
4 Replies
MathewCoyle
Frequent Contributor
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001p000000.htm
has some good info on field properties


This should get you started
fields = arcpy.ListFields("layer")

for f in fields:
    if f.name == "Something you want to change"
        f.aliasName = "New Alias"
0 Kudos
AnthonyFarndon
Occasional Contributor
Thanks, hadn't realised the listFields 'getter' could also be used as a setter!
0 Kudos
MathewCoyle
Frequent Contributor
Oh I think you might be right, I may have used field mappings before to set them.
0 Kudos
AnthonyFarndon
Occasional Contributor
OK, thanks 😞
0 Kudos