AnsweredAssumed Answered

Read Field Alias from mxd in arcpy

Question asked by lukas.wuersch_CDE on Apr 21, 2020
Latest reply on Apr 22, 2020 by lukas.wuersch_CDE

Hi,

 

I noticed that the field alias name, which is shown in the attribute table of ArcMap, does not correspond with the field alias name accessible in arcpy. 

 

For example, when "manually" changing the field alias name in the .mxd's attribute table, the alias in arcpy does not change. (accessed alias in arcpy like this)

for field in arcpy.ListFields('<Featureclass>'):
     print field.aliasName

 

Is there a way to read the alias name with arcpy (the one created manually, which is saved in the mxd) ?

 

The reason for the question is that I work with a large amount of layers whose field alias names were modified manually in mxds and i need to access those aliases in arcpy. So I am looking for an automated way to read the aliases from the attribute table and then overwrite the actual field aliases with arcpy (using arcpy.management.AlterField).

 

I would highly appreciate any help or hints.

 

Outcomes