Problem: Unable to delete a large number of features in ArcGIS Online from a REST endpoint
When attempting to delete a large number of records, for example 100,000, from a feature service using the Delete Feature option at the Service URL of an ArcGIS Online service, the deletion fails. However, it is possible to delete about 3000 records. In some instances, an error with characters is returned after an attempt to delete the features.
This is a known issue, and a bug has been reported; BUG-000084640.
Solution or Workaround
Use the following steps to delete a large number of features in one request:
- Log in to www.arcgis.com with administrator credentials.
- Click My Content, and navigate to the intended feature service. Open the feature service.
Note: If the error, "There are no services available" is returned when visiting the ArcGIS REST Administrator Directory, the hosted feature service is shared with 'Everyone' (public).
- In the item details page of the feature service, click the hyperlink under Layers. The ArcGIS REST Services Directory page opens.
- In ArcGIS REST Service Directory, click Delete Feature.
- Set up the parameters depending on the desired number of features to delete.
- Ensure that the Rollback on Failure option is set to True.
When the Rollback on Failure option is set to true, it ensures that if any error occurs during editing a service, all edits are rolled back (which means the edits are not applied), and the operation returns an error in the response. This setting is used when the edits are such that user either wants all or none applied.