This is a duplicate of this issue posted in 2017: https://community.esri.com/t5/python-questions/fieldinfo-getvisible-method-returns-quot-visible/td-p...
Bug report here: https://support.esri.com/en/bugs/nimbus/TklNMTAxNDA4
I need to publish a webmap to Online from Pro with hundreds of layers. In Pro, I need to turn the "Shape" field visible, since I can't publish as a Webmap unless the Shape fields are visible.
So, I tried to use arcpy to turn the "Shape" fields visibility to "VISIBLE"
for m in aprx.listMaps():
for lyr in m.listLayers():
if not lyr.isGroupLayer:
desc = arcpy.Describe(lyr)
for i in range(0,desc.fieldInfo.count):
if desc.fieldInfo.getFieldName(i) == "Shape":
print(desc.fieldInfo.getVisible(i))
This returns VISIBLE for all "Shape" fields in all layers, even if they're not in Fields view.
Any way to avoid going through each layer and updating visibility by hand?
The bug report indicates that it was updated last week, but it doesn't seem like there's any plan to fix this.
NIM101408: The fieldinfo.getvisible method always returns Visib.. (esri.com)
Will Not Be Addressed
The development team has considered the issue or request and concluded it will not be addressed. The issue's Additional Information section may contain further explanation.
Additional Information
We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.
I would contact tech support and see if they can provide an answer as to why this is not possible