<?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: Add field alias if field already exists in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346664#M27171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001p000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001p000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;has some good info on field properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should get you started&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fields = arcpy.ListFields("layer")

for f in fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if f.name == "Something you want to change"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.aliasName = "New Alias"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:19:52 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2021-12-11T16:19:52Z</dc:date>
    <item>
      <title>Add field alias if field already exists</title>
      <link>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346663#M27170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to add/amend&amp;nbsp; field alias if field already exists i.e. not going the AddField_management() route?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2011 19:29:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346663#M27170</guid>
      <dc:creator>AnthonyFarndon</dc:creator>
      <dc:date>2011-06-02T19:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Add field alias if field already exists</title>
      <link>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346664#M27171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001p000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001p000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;has some good info on field properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should get you started&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fields = arcpy.ListFields("layer")

for f in fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if f.name == "Something you want to change"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.aliasName = "New Alias"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346664#M27171</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T16:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add field alias if field already exists</title>
      <link>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346665#M27172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, hadn't realised the listFields 'getter' could also be used as a setter!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2011 19:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346665#M27172</guid>
      <dc:creator>AnthonyFarndon</dc:creator>
      <dc:date>2011-06-02T19:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Add field alias if field already exists</title>
      <link>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346666#M27173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh I think you might be right, I may have used field mappings before to set them.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2011 20:02:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346666#M27173</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-06-02T20:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add field alias if field already exists</title>
      <link>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346667#M27174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, thanks &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2011 20:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-field-alias-if-field-already-exists/m-p/346667#M27174</guid>
      <dc:creator>AnthonyFarndon</dc:creator>
      <dc:date>2011-06-02T20:45:15Z</dc:date>
    </item>
  </channel>
</rss>

