Can you set a field as unique using the arcgis rest api for python?
You can, enabling unique values means adding an index with a unique constraint to the field. To do this in the API you'll want to call the FeatureLayerManager's add_to_definition() function, passing in something like this:
{"indexes":[ {"fields":"MyField", "isUnique":True, "description":"For uniqueness"} ]}
thanks that works - this is the code:
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.