Turning Off Fields via Python

614
2
11-27-2017 03:37 PM
Highlighted
New Contributor

Has ESRI changed the Field Visibility property from Read Only yet. I need to make a script to turn off specific fields in a feature class and everything points to having to export to a new layer which defeats the purpose of why I need it. I found a post where they said they were going to resolve this issue that was dated 2013 so I am wondering if this has been updated or if there is any sort of workaround for this.  

Reply
0 Kudos
2 Replies
Highlighted
MVP Esteemed Contributor

From the arcpy Field class, the available properties are still pretty much the same, but the FieldInfo properties have 'get' and 'set' for a field in a table 

setVisible (index, visible)  Set the visible flag of a field on the table.

Highlighted
Esri Esteemed Contributor

There was a more recent thread related to this: Toggling Fields within a Feature Class On and Off  and many older ones all pointing to a rather cumbersome method of doing this like: Turn fields off by script