Select to view content in your preferred language

REST ApplyEdits on ESRIRequest Layer

645
1
Jump to solution
04-26-2022 05:17 AM
by Anonymous User
Not applicable

I'm trying to apply edits on a layer that i fetch through a ESRIRequest action.

Basically, I'm fetching the layer like this and trying to apply my edits with 'then' :

 

 

url = https://somewebsite/rest/services/app/app1/FeatureServer/applyEdits

let newAcc = {
        "attributes": {dataFeatureAcc}
      }

request(url).then(function (response) {
      response.data.applyEdits: [newAcc]
    });

 

  This used to work withtout the request, but I'm required to use it. I found the documentation but don't find it usefull as it only shows the data structure that the edited features should have. It doesn't show how to apply the edits. Can someone help me out ? Many thanks.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

@Anonymous User 

The applyEdits method is present on the FeatureLayer class. Currently your code is attempting to execute that method on a array of Graphics. You need to instantiate a FeatureLayer class from your URL and call the load method (assuming that you are not loading that FeatureLayer class to the map Then you can call the FeatureLayer class applyEdits method.

View solution in original post

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

@Anonymous User 

The applyEdits method is present on the FeatureLayer class. Currently your code is attempting to execute that method on a array of Graphics. You need to instantiate a FeatureLayer class from your URL and call the load method (assuming that you are not loading that FeatureLayer class to the map Then you can call the FeatureLayer class applyEdits method.

0 Kudos