Hey guys,
adds=[
{
"attributes": {
"pid": "1033",
"parentid": "1033",
"instanceid": "1",
"moduleid": "PRJLOCN",
"mapcontrolname": "PRJLOCNGISMapControl",
"geometryid": "1",
"projectname": "locationTest",
"projectcode": "locationTest",
"title": "s",
"description": ""
},
"geometry": {
"rings": [
[
[
-12444372.055961894,
3771472.2607350508
],
[
-12442843.31539619,
3771472.2607350508
],
[
-12442843.31539619,
3769332.0239430647
],
[
-12444372.055961894,
3769332.0239430647
],
[
-12444372.055961894,
3771472.2607350508
]
]
],
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
}
}
}
]
This is the JSON I'm passing to add (I've removed add when passing) and when I do it,
{ "error": { "code": 500, "message": "Unable to complete operation.", "details": [ "No edits ('adds', 'updates', 'deletes', or 'attachment edits') were specified." ] } }
Getting these errors when trying to add the data. What could be the issue?
applyEdits requires an edits parameter. If you remove 'adds', then you haven't specified 'adds', or updates or deletes for that matter. This is why you are getting the error message.
Your request should look like this:
[
{
"id" : 0,
"adds" : [
{
"geometry" : {
"x": -143.501,
"y": 57.043000000000006
},
"attributes": {
"datetime": 1272210710000,
"depth": 31.100000000000001,
"region": "Andreanof Islands, Aleutian Islands, Alaska"
}
},
{
"geometry": {
"x": -72.865099999999927,
"y": -37.486599999999953
},
"attributes": {
"datetime": 1272210142999,
"depth": "40.x",
"region": "Bio-Bio, Chile"
}
}
],
"updates": [
{
"geometry": {
"x": -149.450,
"y": 60.120
},
"attributes": {
"OBJECTID": 50,
"datetime": 1272210710000,
"region": "Andreanof Islands, Aleutian Islands, Alaska"
}
}
],
"deletes": [
19,23
]
},
{
"id": 1,
"deletes": [
34,44
]
}
]
https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits-feature-service-.htm
I'm adding like this to check if it's working properly. Got the error when I added the add JSON. Will this require Edits parameter as well?
Ah - that's looks ok.
Does it work without the URL attribute? if the unencoded value is throwing it off?
Is the feature valid? Polygon, fields, unique values etc?