How can the visibility scale be set using the ArcGIS API for Python
When I set the visibility scale for a list of Feature Layers in an AGOL map and update the Feature Layers, the visibility scale settings for each layer goes back to the default.
Is there a way to update the visibility scale settings using the ArcGIS API for Python? I don't want to have to go in and set the visibility scale settings manually after every update.
You should switch to use Pro. You manually set your visibilities there once and every time you publish they stay the same.
However, I never had an issue publishing from and MXD either, they always stayed as they were in the MXD
AGO Online, or other it is all the same. Do you use grouping in your MXD or Project. That may be doing away with your Visibility settings
Thanks for your reply.
The map is created in AGOL, not published from ArcGIS Pro or an MXD.
The process needs to be automated as the data is updated frequently and needs to be uploaded regularly and frequently. As soon as a change is made to the database a process is started automatically that uploads the new datasets to AGOL.
If there is not a way to set the visibility scale using the API, can a service published from an MXD, as you describe, be automated?
If you can publish a service definition from an mxd or Pro it should set up your features just like they would be have on your desktop version. However, if the name of the data is changing then you may have to look to a scripted fix.
I could do that and the data names and schemas are unchanged between updates. However, my understanding of AGOL is that datasets are not automatically updated from the source, in this case an SDE GeoDatabase.
Once the service definition is published, how are the datasets now on AGOL updated when the database is updated?