<?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: cim_lyr.featureTable.fieldDescriptions returns an empty list in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1047288#M60793</link>
    <description>&lt;P&gt;I understand the catch-22.&amp;nbsp; The CIM was designed to be an efficient storage mechanism for quickly recreating the content in a project.&amp;nbsp; The CIM was not designed specifically to support APIs but rather can be used by APIs to access properties that may not be available to the published API.&amp;nbsp; This "known limitation" means that we need to add field management capabilities to the published API.&amp;nbsp; That will take time and in some cases, may not happen.&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp and Layout Teams&lt;/P&gt;</description>
    <pubDate>Wed, 14 Apr 2021 21:01:43 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2021-04-14T21:01:43Z</dc:date>
    <item>
      <title>cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046116#M60749</link>
      <description>&lt;P&gt;Why would&amp;nbsp;cim_lyr.featureTable.fieldDescriptions return an empty list when the feature layer clearly contains fields?&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1135"&gt;@JeffMoulds&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 21:37:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046116#M60749</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2021-04-12T21:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046131#M60751</link>
      <description>&lt;P&gt;Marvis,&lt;/P&gt;&lt;P&gt;It shouldn't.&amp;nbsp; Can you supply the few lines of code that grabs the field list?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Jeff - arcpy.mp and Layout teams&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 22:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046131#M60751</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-04-12T22:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046468#M60768</link>
      <description>&lt;P&gt;p=arcpy.mp.ArcGISProject("current")&lt;BR /&gt;m=p.listMaps()[0]&lt;BR /&gt;l=m.listLayers()[0]&lt;BR /&gt;c=l.getDefinition('V2')&lt;BR /&gt;fields=c.featureTable.fieldDescriptions&lt;/P&gt;&lt;P&gt;print (fields) prints an empty list.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 17:23:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046468#M60768</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2021-04-13T17:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046483#M60769</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fieldDesc.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10714i10B4FFCE0610709F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fieldDesc.PNG" alt="fieldDesc.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;According to property tip in the image above, there is an expectation for an argument for the fieldDescriptions property otherwise it creates an empty list.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 17:37:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046483#M60769</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2021-04-13T17:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046620#M60773</link>
      <description>&lt;P&gt;I'm not sure what to say.&amp;nbsp; Does your FC have an attribute table?&amp;nbsp; &amp;nbsp;I just tried the following on a simple polygon layer.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]
l = m.listLayers()[0]
c = l.getDefinition('V2')
fields = c.featureTable.fieldDescriptions
len(fields)
15&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; You are welcome to send me a layer package to &lt;A href="mailto:jbarrette@esri.com" target="_blank"&gt;jbarrette@esri.com&lt;/A&gt;&amp;nbsp;and I can take a look.&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp and Layout teams&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 20:29:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046620#M60773</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-04-13T20:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046671#M60774</link>
      <description>&lt;P&gt;I want to thank you Marvis for sending me your data.&amp;nbsp; I was able to reproduce and then checked in with our CIM experts. I learned something too.&lt;/P&gt;&lt;P&gt;"We only write field descriptions if they differ from the default for that field.&amp;nbsp;Once you make some change (to the field visibility, or alias, or formatting, etc.) to any field, then we populate that entire collection. Doing it this way keeps the layer representation small. Think of them as overrides."&lt;/P&gt;&lt;P&gt;So to get this to work, I simply went into the fields view and changed the visibility of OID.&amp;nbsp; I made it not visible.&amp;nbsp; Then I saved the project and ran the same code and I could see ALL fields.&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp and Layout teams&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 22:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1046671#M60774</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-04-13T22:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1047172#M60788</link>
      <description>&lt;P&gt;Jeff, I used your methodology and was able to get the fields to become available so I will mark it as the answer. However, this methodology is not very practical for scripting purposes. Attempting to access the fields inside a python script will always return an empty list unless the user first manually updates a field which then makes the script unnecessary.&lt;/P&gt;&lt;P&gt;Fyi: My original goal was to run a script that would freeze certain fields of a given attribute table. Jeff had mentioned that this could be accomplished by the isLocked property on the cim.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 18:01:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1047172#M60788</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2021-04-14T18:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1047288#M60793</link>
      <description>&lt;P&gt;I understand the catch-22.&amp;nbsp; The CIM was designed to be an efficient storage mechanism for quickly recreating the content in a project.&amp;nbsp; The CIM was not designed specifically to support APIs but rather can be used by APIs to access properties that may not be available to the published API.&amp;nbsp; This "known limitation" means that we need to add field management capabilities to the published API.&amp;nbsp; That will take time and in some cases, may not happen.&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp and Layout Teams&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:01:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1047288#M60793</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-04-14T21:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1098289#M62399</link>
      <description>&lt;P&gt;I am in the same boat here. I have a script that adds a feature class multiple times with different definition queries and there are MANY fields in them. I created a bit of a workaround to "enable" the CIM fieldDescriptions and that is to use an arcpy.AlterField to update the SHAPE field's alias:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;arcpy.AlterField_management(lyr, "SHAPE", new_field_alias="Shape")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I wish this wasn't the case as it add a lot of time on the running of the script.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 00:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1098289#M62399</guid>
      <dc:creator>julian_svcs</dc:creator>
      <dc:date>2021-09-15T00:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1098294#M62400</link>
      <description>&lt;P&gt;I just found out that if the layer's datasource is the same in the same map, it will "enable" the CIM fieldDescriptions for all of them. Just add a check if you have already altered the field for a datasource or if the length of the fieldDescriptions is 0.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 00:47:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1098294#M62400</guid>
      <dc:creator>julian_svcs</dc:creator>
      <dc:date>2021-09-15T00:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1216997#M65706</link>
      <description>&lt;P&gt;It seems that altering the Shape field alias no longer generates the CIM which is frustrating. Following this workflow all of my CIM objects are still empty when using&amp;nbsp;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;cim_obj&lt;/SPAN&gt;&lt;SPAN&gt;.featureTable.fieldDescriptions) even though in the APRX the alias has been changed.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 16:13:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1216997#M65706</guid>
      <dc:creator>AaronDutch</dc:creator>
      <dc:date>2022-09-28T16:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1217096#M65708</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/101721"&gt;@AaronDutch&lt;/a&gt;&amp;nbsp;That is strange. I just tested this using ArcGIS Pro 3.0 and it works as expected. I read the fieldDescriptions before changing the alias and it is empty (as expected). When I use AlterField to change the SHAPE field alias and then call the fieldDescriptions again, I get the field details.&lt;/P&gt;&lt;P&gt;Here is my sample code that worked for me:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps(aprx.activeMap.name)[0]
for lyr in m.listLayers():
    if lyr.isFeatureLayer:
        print(f"{lyr.longName}")
        arcpy.AlterField_management(lyr, "SHAPE", new_field_alias="Shape")
        cim_lyr = lyr.getDefinition('V2')
        print(cim_lyr.featureTable.fieldDescriptions)
        for fd in cim_lyr.featureTable.fieldDescriptions:
            print(f"Field Name: {fd.fieldName}")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 28 Sep 2022 19:09:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1217096#M65708</guid>
      <dc:creator>julian_svcs</dc:creator>
      <dc:date>2022-09-28T19:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1311446#M68246</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;thanks for the thread which already helped me a lot when I encountered the empty list.&lt;/P&gt;&lt;P&gt;As I aim to build a Python tool that can change the fieldDescription of a selected layer, I needed to modify the layer with arcpy.AlterField_management() from inside the tool.&lt;/P&gt;&lt;P&gt;Unfortunately, the CIM&amp;nbsp;fieldDescription list is still empty after running the tool. In contrast, If I do the AlterField operation from the Python Window in ArcGIS Pro, the fieldDescription list is getting populated.&lt;/P&gt;&lt;P&gt;Does anyone have an idea how that could be and how the execution of a function from either Python Window or Python Toolbox differs?&lt;/P&gt;&lt;P&gt;Using ArcGIS Pro 3.0.3&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 12:24:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1311446#M68246</guid>
      <dc:creator>Pascal</dc:creator>
      <dc:date>2023-07-25T12:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1359481#M69385</link>
      <description>&lt;P&gt;I experience the same issue when running Pro 3.2.0. When running AlterField in a geoprocessing script tool, fieldDescription is not being populated. When running in the Python Window it is.&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134" target="_blank"&gt;@JeffBarrette&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 00:32:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1359481#M69385</guid>
      <dc:creator>PhilLarkin1</dc:creator>
      <dc:date>2023-12-12T00:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: cim_lyr.featureTable.fieldDescriptions returns an empty list</title>
      <link>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1669558#M74953</link>
      <description>&lt;P&gt;I know this is a really old post but I was going through some old emails, etc and came across this thread.&amp;nbsp; I've helped people address this issue (differently than AlterField) and want to paste that code here as an option for people to try.&lt;/P&gt;&lt;P&gt;Basically, if there are NO field descriptions (e.g., a layer was just added), then another option is to use MakeFeatureLayer.&amp;nbsp; The MakeFeatureLayer result has the CIM properties.&amp;nbsp; You make the changes and than copy those changes back to the original layer.&amp;nbsp; There are pre3.4 and 3.4 and beyond options.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def updateCIMFields(l, cimLyr):
    fList = ["SQKM", "POP2001", "Shape_Length", "Shape_Area"]

    for fd in cimLyr.featureTable.fieldDescriptions:
        if fd.fieldName in fList:
            fd.numberFormat.roundingOption = "esriRoundNumberOfDecimals"
            fd.numberFormat.roundingValue = 0
            fd.numberFormat.zeroPad = True
            fd.numberFormat.useSeparator = True
    l.setDefinition(cimLyr)
    return cimLyr
    
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]

lyr = m.listLayers('Provinces')[0]
lyr_cim = lyr.getDefinition('V3')

if len(lyr_cim.featureTable.fieldDescriptions) == 0:  #NO CIM field info present
    print('No CIM Field Info')

    mkLyr = arcpy.management.MakeFeatureLayer(lyr)[0]
    mkLyr_cim = mkLyr.getDefinition('V3')
    mkLyr_cim = updateCIMFields(mkLyr, mkLyr_cim)

    #Copy CIM information and remove temporary layer
    #lyr_cim.featureTable.fieldDescriptions = mkLyr_cim.featureTable.fieldDescriptions  ###for 3.3 and prior
    #lyr.setDefinition(lyr_cim)                                                         ###for 3.3 and prior
    lyr.pasteProperties(mkLyr, 'FIELD_PROPERTIES')                                      ###for 3.4 and prior
    m.removeLayer(mkLyr)

else:                                                 #CIM field info present
    print('CIM Field Info Pre-Exists')
    lyr_cim = updateCIMFields(lyr, lyr_cim)
    lyr.setDefinition(lyr_cim) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp Team&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 04:56:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cim-lyr-featuretable-fielddescriptions-returns-an/m-p/1669558#M74953</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2025-12-02T04:56:06Z</dc:date>
    </item>
  </channel>
</rss>

