Select to view content in your preferred language

"No edits ('adds', 'updates', 'deletes', or 'attachment edits') were specified."

1211
4
11-28-2023 01:38 AM
Labels (1)
SantoshS
Emerging Contributor

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?

0 Kudos
4 Replies
ChristopherCounsell
MVP Regular Contributor

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

 

0 Kudos
SantoshS
Emerging Contributor

SantoshS_0-1701165961495.png

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?

0 Kudos
ChristopherCounsell
MVP Regular Contributor

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?

0 Kudos
RiyaD67
New Contributor

I need help with a similar issue i am facing .i am using a Omnistudio Integration Procedure

The request that I am sending is this

{
 
  "ElapsedTime"1615,
  "Type""Rest Action",
  "Input": {
    "body": {
      "adds""{attributes={objectid=8402, active_date=11/26/2024, application_status=Pending Acceptance, inactive_date=11/26/2024, permit_type=Pre Construction Notification, permit_id=0cEWC0000002KM12AM, project_name=Sunnyvale Wetland Restoration Project, application_id=BL-0000000299, application_date=3/3/2025, construction_start=1/22/2025, construction_end=1/15/2026, agency=Other, project_size=45, complaint_type=Hazardous Waste, complaint_location_desc=No Description, complaint_desc=too much waste, complaint_ongoing_occurrence=Yes, complaint_timeframe=Exact}}"
    },
    "headers": {
      "Authorization""Bearer plCzAOOuCpBs2AIQMVpZpcOWdQ1Pu1lDigD9edWZijqepnd5T-aIBFyDGNwLZN3De0uNq36PP3S9YCbyDXuJuFOpplW_AJaCIhPK46E3qd0ucw0h-2f7MfYuuJ3QI521HcJDZTa9EAhMJQzm8utc-JWc4pyFQOxJSCXkU2CVfYo."
    }
  },
 
 
 
 
  "Status"true
}
 
 
 
 
 
The response I get is this
{
  "error": {
    "details": [
      "No edits ('adds', 'updates', 'deletes', 'attachment edits', or 'asset maps edits') were specified."
    ],
    "message""Unable to complete operation.",
    "code"500
  },
  "rawHttpResp": {
    "adds": [
      {
        "attributes": {
          "complaint_timeframe""Exact",
          "complaint_ongoing_occurrence""Yes",
          "complaint_desc""too much waste",
          "complaint_location_desc""No Description",
          "complaint_type""Hazardous Waste",
          "project_size""45",
          "agency""Other",
          "construction_end""1/15/2026",
          "construction_start""1/22/2025",
          "application_date""3/3/2025",
          "application_id""BL-0000000299",
          "project_name""Sunnyvale Wetland Restoration Project",
          "permit_id""0cEWC0000002KM12AM",
          "permit_type""Pre Construction Notification",
          "inactive_date""11/26/2024",
          "application_status""Pending Acceptance",
          "active_date""11/26/2024",
          "objectid"8402
        }
      }
    ]
  },
  "rawResponse": {
    "error": {
      "details": [
        "No edits ('adds', 'updates', 'deletes', 'attachment edits', or 'asset maps edits') were specified."
      ],
      "message""Unable to complete operation.",
      "code"500
    }
  }
}
 
I guess the HTTP hits the url but still its unable to access it
0 Kudos