<?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: Return system fields in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386569#M30498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the replies guys, they are very much appreciated. Neil, that is &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;exactly&lt;/SPAN&gt;&lt;SPAN&gt; what I was after!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Oct 2013 23:35:28 GMT</pubDate>
    <dc:creator>GinoMellino</dc:creator>
    <dc:date>2013-10-13T23:35:28Z</dc:date>
    <item>
      <title>Return system fields</title>
      <link>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386565#M30494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a pretty straight-forward question...is there any way to return a list of system fields or differentiate between system managed fields vs user fields using ArcPy? I'm talking about being able to single out fields such as OBJECTID, FID, SHAPE.AREA, SHAPE, etc. I know I can get a reference to them by name but I was hoping there would be a more elegant way of achieving this? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gino&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. I am sorry if this is a duplicate question, I did search for the answer but came up with bupkis. If so please smack my backside and send me to the correct thread :eek:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 02:04:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386565#M30494</guid>
      <dc:creator>GinoMellino</dc:creator>
      <dc:date>2013-10-11T02:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Return system fields</title>
      <link>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386566#M30495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perhaps something like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
sysFieldList = []
attFields = arcpy.ListFields(fc_name)
for attField in attFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if attField.required:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sysFieldList.append(attField)

print "System Fields", sysFieldList
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386566#M30495</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-11T17:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Return system fields</title>
      <link>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386567#M30496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gino,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Additional to what Neil is showing you can determine the name of the Shape field by describing it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
desc = arcpy.Describe(r'path to your featureclass')
fldNameShape = desc.shapeFieldName
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Find more info about the describe properties of a Featureclass here: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/FeatureClass_properties/018v00000011000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;FeatureClass properties (arcpy)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another way of accessing standard fields (not determining the name though) is using tokens in for instance an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;arcpy.da.SearchCursor&lt;/SPAN&gt;&lt;SPAN&gt;. Some examples are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;SHAPE@ �?? A geometry object for the feature.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;SHAPE@AREA �?? A double of the feature's area.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;SHAPE@LENGTH �?? A double of the feature's length.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;OID@ �?? The value of the ObjectID field.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;You can find Python code examples here: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/SearchCursor/018w00000011000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;SearchCursor (arcpy.da)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:45:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386567#M30496</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T17:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Return system fields</title>
      <link>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386568#M30497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, the above code should be modified to return the name attribute of the field object...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;sysFieldList = [] attFields = arcpy.ListFields(fc_name) for attField in attFields: &amp;nbsp;&amp;nbsp;&amp;nbsp; if attField.required: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sysFieldList.append(attField.name)&amp;nbsp; print "System Fields", sysFieldList&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;You can get other attributes like type, aliasName etc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 11:21:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386568#M30497</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2013-10-11T11:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Return system fields</title>
      <link>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386569#M30498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the replies guys, they are very much appreciated. Neil, that is &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;exactly&lt;/SPAN&gt;&lt;SPAN&gt; what I was after!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Oct 2013 23:35:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/return-system-fields/m-p/386569#M30498</guid>
      <dc:creator>GinoMellino</dc:creator>
      <dc:date>2013-10-13T23:35:28Z</dc:date>
    </item>
  </channel>
</rss>

