<?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>idea Ability to Turn Off Fields on an existing Layer with Python in ArcGISPro in Python Ideas</title>
    <link>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idi-p/1041412</link>
    <description>&lt;P&gt;This is related to the post:&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/turn-off-fields-with-python/td-p/403316/page/2" target="_blank"&gt;https://community.esri.com/t5/python-questions/turn-off-fields-with-python/td-p/403316/page/2&lt;/A&gt;&lt;BR /&gt;by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/144469"&gt;@DylanHarwell&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is a need to be able to turn on and off Fields in Python on Layers that have been created by joins or on existing layers in a project via ArcPy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a sample workflow:&lt;BR /&gt;1. Create a new feature class via Spatial Join of 2 Layers&lt;/P&gt;&lt;P&gt;2. Use Create Feature Layer to create a layer from the Feature Class&lt;/P&gt;&lt;P&gt;3. Create a&amp;nbsp;creates a geoprocessing field info object from the new Layer.&lt;/P&gt;&lt;P&gt;4. Iterate through the field info object to set fields as hidden or visible&lt;BR /&gt;&lt;BR /&gt;5. NEW: Use the Field Info object to set the fields in the new Layer created earlier.&lt;/P&gt;&lt;P&gt;OR make the&amp;nbsp;arcpy.Describe().FieldInfo function able to access a new Feature Class that not currently displayed as a Layer.There were (cumbersome) solutions for ArcMap.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2021 02:11:13 GMT</pubDate>
    <dc:creator>LeandraGordon</dc:creator>
    <dc:date>2021-03-29T02:11:13Z</dc:date>
    <item>
      <title>Ability to Turn Off Fields on an existing Layer with Python in ArcGISPro</title>
      <link>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idi-p/1041412</link>
      <description>&lt;P&gt;This is related to the post:&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/turn-off-fields-with-python/td-p/403316/page/2" target="_blank"&gt;https://community.esri.com/t5/python-questions/turn-off-fields-with-python/td-p/403316/page/2&lt;/A&gt;&lt;BR /&gt;by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/144469"&gt;@DylanHarwell&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is a need to be able to turn on and off Fields in Python on Layers that have been created by joins or on existing layers in a project via ArcPy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a sample workflow:&lt;BR /&gt;1. Create a new feature class via Spatial Join of 2 Layers&lt;/P&gt;&lt;P&gt;2. Use Create Feature Layer to create a layer from the Feature Class&lt;/P&gt;&lt;P&gt;3. Create a&amp;nbsp;creates a geoprocessing field info object from the new Layer.&lt;/P&gt;&lt;P&gt;4. Iterate through the field info object to set fields as hidden or visible&lt;BR /&gt;&lt;BR /&gt;5. NEW: Use the Field Info object to set the fields in the new Layer created earlier.&lt;/P&gt;&lt;P&gt;OR make the&amp;nbsp;arcpy.Describe().FieldInfo function able to access a new Feature Class that not currently displayed as a Layer.There were (cumbersome) solutions for ArcMap.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 02:11:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idi-p/1041412</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2021-03-29T02:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ability to Turn Off Fields on an existing Layer with Python in ArcGISPro</title>
      <link>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1042068#M29</link>
      <description>&lt;P&gt;Leandra,&lt;/P&gt;&lt;P&gt;This can be done using Python CIM Access.&amp;nbsp; Here is the help topic that describes what that means and there is even a sample that does exactly what you are requesting.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Code snippet under Example 2: Modify field properties&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Reference a project, map, and layer using arcpy.mp
p = arcpy.mp.ArcGISProject('current') 
m = p.listMaps('Map')[0]
lyr = m.listLayers('GreatLakes')[0]

# Get the layer's CIM definition
cim_lyr = lyr.getDefinition('V2')

# Make changes to field properties
for fd in cim_lyr.featureTable.fieldDescriptions:
    if fd.fieldName == "OBJECTID":
        fd.visible = False            #Do not display this field
    if fd.fieldName == "Shape_Area":
        fd.alias = "Area (hectares)"  #Change field alias

# Push the changes back to the layer object
lyr.setDefinition(cim_lyr)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 18:33:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1042068#M29</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-03-30T18:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ability to Turn Off Fields on an existing Layer with Python in ArcGISPro - Status changed to: Already Offered</title>
      <link>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1042084#M30</link>
      <description />
      <pubDate>Tue, 30 Mar 2021 18:56:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1042084#M30</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2021-03-30T18:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ability to Turn Off Fields on an existing Layer with Python in ArcGISPro</title>
      <link>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1044938#M37</link>
      <description>&lt;P&gt;Thanks Again!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 03:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1044938#M37</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2021-04-08T03:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Ability to Turn Off Fields on an existing Layer with Python in ArcGISPro</title>
      <link>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1686767#M569</link>
      <description>&lt;P&gt;I'd argue the method suggested as the fix has too many restrictions that render the "already offered" insufficient and inadequate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The AlterField method does not work and instead throws an error:&lt;BR /&gt;&lt;STRONG&gt;ERROR 000499: table is not editable&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is this AlterField hack intended for unversioned datasets only?&lt;/P&gt;&lt;P&gt;This must be ran on an open Pro aprx, as CURRENT? That is not helpful for turning it into a reoccurring maintenance script/ process.&lt;/P&gt;&lt;P&gt;From the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_blank" rel="noopener"&gt;docs&lt;/A&gt;: &lt;STRONG&gt;&lt;EM&gt;"Chances are that if you add a new feature class or table to a map, the CIM will not have any&amp;nbsp;&lt;SPAN class=""&gt;fieldDescriptions&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;and therefore, you won't be able to modify the field properties."&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp; When does it not become 'new'?&amp;nbsp; Closing and reopening the project doesn't seem to change anything- for scripting it makes logical sense that we apply field visibilities/ definition queries to these datasets in one script operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;We are most likely trying to programmatically create/ set views and hide certain fields when we are working in the CIM and even running a tool that modifies tables is not a good idea as a solution, even if it says it doesn't alter it.&lt;BR /&gt;&lt;BR /&gt;Why are the fields&amp;nbsp;fieldDescriptions not populated when the layer is first loaded?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/cim-fielddescriptions-is-not-accessible-for-some/td-p/1332453" target="_blank" rel="noopener"&gt;cim-fielddescriptions-is-not-accessible-for-some&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 21:32:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/ability-to-turn-off-fields-on-an-existing-layer/idc-p/1686767#M569</guid>
      <dc:creator>jmk_307</dc:creator>
      <dc:date>2026-02-25T21:32:32Z</dc:date>
    </item>
  </channel>
</rss>

