Select to view content in your preferred language

Is it possible to update coded value domains using Javascript API 3.21?

882
1
09-01-2017 09:42 AM
ChrisSeabrooke1
New Contributor III

We use coded value domains for many feature layers. We can modify with an administrator login to ArcGIS Pro or by updating the Hosted Feature Service in ArcGIS online. Is there a way to update the definitions through the Javascript API?

Tags (1)
0 Kudos
1 Reply
ThomasSolow
Regular Contributor

I believe you could this via the REST API.

To edit a layer within a feature service: ArcGIS REST API 

The thing to note here is that these kinds of calls allow you to redefine everything about a feature service/layer within a feature service, so it's easy to mess something up.  I'm not sure what domain JSON looks like exactly, but you should be able to get JSON for a feature layer, edit the domains on it, and post it using the above call.

edit- I should say that I don't believe there's a JS API wrapper around that REST call, but you can use esri/Request to make the request.

0 Kudos