<?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: Getting field name and alias list from data set? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95797#M7446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listfields.htm"&gt;ListFields &lt;/A&gt;to access the fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Sep 2016 20:37:12 GMT</pubDate>
    <dc:creator>BrittneyWhite1</dc:creator>
    <dc:date>2016-09-14T20:37:12Z</dc:date>
    <item>
      <title>Getting field name and alias list from data set?</title>
      <link>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95795#M7444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a script that will dump the field names along with the field alias. I'm looking to get something like the following dumped for a data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field, Alias&lt;/P&gt;&lt;P&gt;TOTPOP_CY, 2015 Total Population&lt;/P&gt;&lt;P&gt;HHPOP_CY, 2015 Population in Households&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 20:28:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95795#M7444</guid>
      <dc:creator>GareySmiley</dc:creator>
      <dc:date>2016-09-14T20:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting field name and alias list from data set?</title>
      <link>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95796#M7445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would use the arcpy &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/describe.htm"&gt;Describe&lt;/A&gt;&amp;nbsp;function. You can then access the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/table-properties.htm"&gt;fields property&lt;/A&gt;&amp;nbsp;which returns a list of Field objects that you can iterate through to get the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/field.htm"&gt;aliasName and baseName&amp;nbsp;properties&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 20:35:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95796#M7445</guid>
      <dc:creator>BrittneyWhite1</dc:creator>
      <dc:date>2016-09-14T20:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Getting field name and alias list from data set?</title>
      <link>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95797#M7446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listfields.htm"&gt;ListFields &lt;/A&gt;to access the fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 20:37:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95797#M7446</guid>
      <dc:creator>BrittneyWhite1</dc:creator>
      <dc:date>2016-09-14T20:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting field name and alias list from data set?</title>
      <link>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95798#M7447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# This is essentially the line you'll need&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;aliasName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;PathToTable&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# This is an example of a way to use it&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Name,Alias"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; item &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;aliasName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;PathToTable&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;","&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;"""
The above section would output something like

Name,Alias
OBJECTID,OBJECTID
Shape,Shape
AREANAME,AREA NAME
POP2000, POP 2000
"""&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:39:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/95798#M7447</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2021-12-10T23:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting field name and alias list from data set?</title>
      <link>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/1135741#M63553</link>
      <description>&lt;PRE&gt;for f in arcpy.Describe(&amp;lt;TheFeatureClass&amp;gt;).fields:&lt;BR /&gt;   if f.name == TheFieldName:&lt;BR /&gt;   FIELD_ALIAS = f.aliasName&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jan 2022 05:10:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-field-name-and-alias-list-from-data-set/m-p/1135741#M63553</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2022-01-21T05:10:50Z</dc:date>
    </item>
  </channel>
</rss>

