<?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: Get the field values from a feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1285276#M67579</link>
    <description>&lt;P&gt;I'm intentionally being vague so as not to deprive you of a learning opportunity. The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/main/arcgis-pro-arcpy-reference.htm" target="_self"&gt;Esri documentation for arcpy&lt;/A&gt; is pretty good. Take a look at the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/listsubtypes.htm" target="_self"&gt;ListSubtypes&lt;/A&gt;, &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listfields.htm" target="_self"&gt;ListFields&lt;/A&gt;, and &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/listdomains.htm" target="_self"&gt;ListDomains&lt;/A&gt; functions.&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2023 16:58:10 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2023-05-03T16:58:10Z</dc:date>
    <item>
      <title>Get the field values from a feature class</title>
      <link>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1284593#M67563</link>
      <description>&lt;P&gt;By following the given criteria need to get the field values of Assettype and Assetgroup from a feature class.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Check if the feature class have subtypes (Assetgroup assigned as subtype field) and also check if the feature class have both the field names(Assetype and Assetgroup).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If it is true then get the values of both field , the field values are domain coded&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using this script but not getting the output&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;PRE&gt;subdict = arcpy.da.ListSubtypes(class_feature)&lt;BR /&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;len&lt;/SPAN&gt;(subdict) &amp;gt; &lt;SPAN&gt;1&lt;/SPAN&gt;:&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;stcode &lt;SPAN&gt;in &lt;/SPAN&gt;subdict:&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;subdict[stcode][&lt;SPAN&gt;'SubtypeField'&lt;/SPAN&gt;] != &lt;SPAN&gt;""&lt;/SPAN&gt;:&lt;BR /&gt;            tsubtypefield = subdict[stcode][&lt;SPAN&gt;"SubtypeField"&lt;/SPAN&gt;]&lt;BR /&gt;            subtypenames.append(subdict[stcode][&lt;SPAN&gt;'Name'&lt;/SPAN&gt;])&lt;BR /&gt;    &lt;SPAN&gt;field_name = ["ASSETTYPE", "ASSETGROUP"]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    field = [f &lt;SPAN&gt;for &lt;/SPAN&gt;f &lt;SPAN&gt;in &lt;/SPAN&gt;desc.fields &lt;SPAN&gt;if &lt;/SPAN&gt;f.name == field_name][&lt;SPAN&gt;0&lt;/SPAN&gt;]&lt;BR /&gt;    domain = arcpy.da.ListDomains(desc.path)[field.domain]&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(class_feature&lt;SPAN&gt;, &lt;/SPAN&gt;field_name) &lt;SPAN&gt;as &lt;/SPAN&gt;cursor:&lt;BR /&gt;        &lt;SPAN&gt;for &lt;/SPAN&gt;row &lt;SPAN&gt;in &lt;/SPAN&gt;cursor:&lt;BR /&gt;           print(row[0],row[1])&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 02 May 2023 05:54:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1284593#M67563</guid>
      <dc:creator>kumarprince8071</dc:creator>
      <dc:date>2023-05-02T05:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get the field values from a feature class</title>
      <link>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1284833#M67570</link>
      <description>&lt;P&gt;This looks an awful lot like a school assignment.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 17:08:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1284833#M67570</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2023-05-02T17:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get the field values from a feature class</title>
      <link>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1285052#M67572</link>
      <description>&lt;P&gt;Can you please give me any suggestions how will i achieve the results as specified?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 05:09:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1285052#M67572</guid>
      <dc:creator>kumarprince8071</dc:creator>
      <dc:date>2023-05-03T05:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get the field values from a feature class</title>
      <link>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1285276#M67579</link>
      <description>&lt;P&gt;I'm intentionally being vague so as not to deprive you of a learning opportunity. The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/main/arcgis-pro-arcpy-reference.htm" target="_self"&gt;Esri documentation for arcpy&lt;/A&gt; is pretty good. Take a look at the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/listsubtypes.htm" target="_self"&gt;ListSubtypes&lt;/A&gt;, &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listfields.htm" target="_self"&gt;ListFields&lt;/A&gt;, and &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/listdomains.htm" target="_self"&gt;ListDomains&lt;/A&gt; functions.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 16:58:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-the-field-values-from-a-feature-class/m-p/1285276#M67579</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2023-05-03T16:58:10Z</dc:date>
    </item>
  </channel>
</rss>

