<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Read Field Alias from mxd in arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/read-field-alias-from-mxd-in-arcpy/m-p/427334#M33585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for&amp;nbsp;the calcification regarding the alter field tool. I can read&amp;nbsp;the alias as described &lt;A _jive_internal="true" href="https://community.esri.com/thread/Using fields and indexes—ArcPy Get Started | Documentation"&gt;here&lt;/A&gt;,&amp;nbsp;but then i get the alias of the feature&amp;nbsp;class, not the one in the mxd i think. What I am looking for is a way to read the alias saved in the mxd, not in the feature class. But maybe that is not possible with arcpy. Thank you for the help anyways.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Apr 2020 12:46:08 GMT</pubDate>
    <dc:creator>LukasWürsch</dc:creator>
    <dc:date>2020-04-22T12:46:08Z</dc:date>
    <item>
      <title>Read Field Alias from mxd in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/read-field-alias-from-mxd-in-arcpy/m-p/427332#M33583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,&amp;nbsp;when "manually" changing the field alias name in the .mxd's attribute table, the alias&amp;nbsp;in arcpy does not change. (accessed alias in arcpy like this)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; field &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'&amp;lt;Featureclass&amp;gt;'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
     &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;aliasName
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to read the alias name&amp;nbsp;with arcpy (the one&amp;nbsp;created manually, which is saved in the mxd) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for the question is that I work with a large amount of layers whose field alias names were modified&amp;nbsp;manually in mxds&amp;nbsp;and i need to access those aliases in arcpy.&amp;nbsp;So I am looking for an automated way to&amp;nbsp;read the aliases from the attribute table and then overwrite&amp;nbsp;the actual field aliases with arcpy (using &lt;SPAN&gt;arcpy.management.AlterField&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would highly appreciate any help or hints.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:14:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/read-field-alias-from-mxd-in-arcpy/m-p/427332#M33583</guid>
      <dc:creator>LukasWürsch</dc:creator>
      <dc:date>2021-12-11T19:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read Field Alias from mxd in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/read-field-alias-from-mxd-in-arcpy/m-p/427333#M33584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't know about arcmap, but in Pro this tools can be used&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/alter-field-properties.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/alter-field-properties.htm"&gt;Alter Field—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Direct arcpy changes I think depend on whether are looking at the layer/table view level or the actual featureclass.&lt;/P&gt;&lt;P&gt;Some reading, or just skip to the last comment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/get-started/fields-and-indexes.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/get-started/fields-and-indexes.htm"&gt;Using fields and indexes—ArcPy Get Started | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can read the alias, but in order to change it either the table needs to be empty or the field depending on what you want to change&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/alter-field-properties.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/alter-field-properties.htm"&gt;Alter Field—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It may be due to the differences between what can be seen or changed at the layer level versus the featureclass level&lt;/P&gt;&lt;P&gt;based on this comments scattered throughout the help files&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;The data source view displays field properties that are at the feature class level, such as the alias for a field, or the field name.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Updating a field property only updates the field object, no changes are made to the actual field in the table or feature class.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In any event, If you can use the AlterField_Management tool in your script, be careful on how you set the parameters&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/189738"&gt;cannot change field alias without changing field name&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2020 04:23:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/read-field-alias-from-mxd-in-arcpy/m-p/427333#M33584</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-04-22T04:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read Field Alias from mxd in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/read-field-alias-from-mxd-in-arcpy/m-p/427334#M33585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for&amp;nbsp;the calcification regarding the alter field tool. I can read&amp;nbsp;the alias as described &lt;A _jive_internal="true" href="https://community.esri.com/thread/Using fields and indexes—ArcPy Get Started | Documentation"&gt;here&lt;/A&gt;,&amp;nbsp;but then i get the alias of the feature&amp;nbsp;class, not the one in the mxd i think. What I am looking for is a way to read the alias saved in the mxd, not in the feature class. But maybe that is not possible with arcpy. Thank you for the help anyways.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2020 12:46:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/read-field-alias-from-mxd-in-arcpy/m-p/427334#M33585</guid>
      <dc:creator>LukasWürsch</dc:creator>
      <dc:date>2020-04-22T12:46:08Z</dc:date>
    </item>
  </channel>
</rss>

