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:
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.