Is there any way to enable attachments on an existing hosted feature service with the API?
Hi Patrick,
Using the code below I was able to turn on and off attachments to the featurelayer.
The code is straightforward, it searches for and finds the layer you want to change.
featLyr = featCollection.layers[0] Code:
from arcgis.gis import GIS gis = GIS("https://www.arcgis.com", "<USERNAME>", "<PASSWORD") srcResults = gis.content.search("title:ServiceAreas",item_type = "Feature Layer") featCollection = srcResults[0] featLyr = featCollection.layers[0] #Get the manager associated with the featurelayer to update mgr = featLyr.manager #Update the featurelayer definition to allow attachments mgr.update_definition({"hasAttachments": False})
Let me know if you have any questions.
Thanks,
Jeff
Thanks Jeff. This works.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.