admin管理员组

文章数量:1415139

I'm using the /applyEdits endpoint to update data in ArcGIS Online. Typically, when an invalid record is included in a batch, the response specifies which record failed while allowing valid records to be processed successfully.

However, I've observed a specific issue when submitting string-type field values containing < and > (e.g., "AssetName": "OM--0002"). In such cases, the entire batch is rejected with a generic error:

Request Example:

{"adds": [{ "attributes": { "AssetName": "OM-NJNEW-0001" } },{ attributes": { "AssetName": "OM--0002" } }, { "attributes": { "AssetName": "OM-NJNEW-0003" } } ]}

Response: { "error": { "code": 400, "message": "", "details": ["Field AssetName has invalid HTML content."] }} This response does not specify which record contains the invalid data, nor does it allow the valid records to be processed.

Expected Behavior (For Other Errors): When other types of errors occur (e.g., type conversion errors), the response typically identifies the specific record that failed while allowing others to be added successfully.

Questions:

Is there a way to get a reference to the specific record causing the "invalid HTML content" error? Shouldn't valid records still be processed, even if one contains invalid data? I would appreciate any insights on handling this scenario in ArcGIS Online.

I'm using the /applyEdits endpoint to update data in ArcGIS Online. Typically, when an invalid record is included in a batch, the response specifies which record failed while allowing valid records to be processed successfully.

However, I've observed a specific issue when submitting string-type field values containing < and > (e.g., "AssetName": "OM--0002"). In such cases, the entire batch is rejected with a generic error:

Request Example:

{"adds": [{ "attributes": { "AssetName": "OM-NJNEW-0001" } },{ attributes": { "AssetName": "OM--0002" } }, { "attributes": { "AssetName": "OM-NJNEW-0003" } } ]}

Response: { "error": { "code": 400, "message": "", "details": ["Field AssetName has invalid HTML content."] }} This response does not specify which record contains the invalid data, nor does it allow the valid records to be processed.

Expected Behavior (For Other Errors): When other types of errors occur (e.g., type conversion errors), the response typically identifies the specific record that failed while allowing others to be added successfully.

Questions:

Is there a way to get a reference to the specific record causing the "invalid HTML content" error? Shouldn't valid records still be processed, even if one contains invalid data? I would appreciate any insights on handling this scenario in ArcGIS Online.

Share Improve this question asked Feb 11 at 12:18 VedVed 433 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Yes, you can do this by using the rollbackOnFailure and returnEditResults properties. The documentation have more details and limitations.

If you want the valid changes to be saved, you can turn off the rollbackOnFailure .

https://developers.arcgis/rest/services-reference/enterprise/apply-edits-feature-service-layer/#request-parameters:~:text=true%20%7C%20false-,rollbackOnFailure,-(Optional)

If you want to see the result per feature, set both returnEditResults and rollbackOnFailure to true.
https://developers.arcgis/rest/services-reference/enterprise/apply-edits-feature-service-layer/#request-parameters:~:text=true%20%7C%20false-,returnEditResults,-(Optional)

Also asked and answered on gis.stackexchange.

本文标签: