Select to view content in your preferred language

How to POST update to a feature where it has a unique attribute instead of ObjectId?

282
2
08-16-2024 06:15 AM
RichT7301
New Contributor

Is it possible to use a where clause in an ArcGIS REST API POST to update attributes of a feature where a custom field as a unique value?

I have a field with unique values in it which I would like to use to identify which feature to update, rather than using ObjectId. The reason I don't want to use ObjectID is because that would require a preceding GET query to obtain the ObjectId, and that will slow down the overall processing, and will double the number of callouts consumed from my system's limit.

0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

You could use Calculate instead.

https://developers.arcgis.com/rest/services-reference/enterprise/calculate-feature-service-layer/

You'd have to format the post differently, but it can update any and all fields on the layer, and includes a where parameter. You could use it to update individual features, with "where=unique_field='some_value'" to restrict the calculation.

- Josh Carlson
Kendall County GIS
0 Kudos
RichT7301
New Contributor

Interesting. Thank you Josh. I'll give that a try.

0 Kudos