We have a fields in a large amount of AGOL hosted feature layers that we want to make un-editable and others that we do not want visible.
Rather than going into the service definition for each and every one to manually change "editable": true to "editable": false for many fields in many feature layers, and then also do the same for "visible", we were hoping to automate the process via the Python API (which we are new to).
So far we have:
from arcgis.gis import gis gis = GIS(.....login info......) mpfs = gis.content.get(......id......) mpfl = mpfs.layers replacementCopy = mpfl.properties.fields for field in replacementCopy: if field.name in (list of names): field["editable"] = False for field in replacementCopy: if field.name in (list of names): field["visible"] = False
But the field properties seem to be missing the "visible" property, and we are not sure how to go about enacting the changes once we have the update field properties.