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 badges1 Answer
Reset to default 0Yes, 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.
本文标签:
版权声明:本文标题:arcgis js api - ESRI applyEdits Endpoint Rejecting Batch Due to 'Invalid HTML Content' – How to Identify the Aff 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745212496a2647970.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论