Select to view content in your preferred language

Delete AGOL hosted features when "update attributes only" set?

696
1
04-15-2019 03:16 PM
JakeJacobs
Occasional Contributor III

I have an ArcGIS Online hosted feature layer that has the Editing setting of "Update Attributes only" because that's what I want users to be able to do in the Collector map they are editing.  The feature layer is sync-enabled and they are working offline. I have probably 20 field users working with offline caches.

However, I discovered that I have some duplicate data in the hosted feature layer - about 5,000 points that I want to delete.

What is the best way to do this?  I know I can open the hosted feature layer in a web map with IsAdmin=true, but then it seems I can only click on one at a time and choose delete.

Is there any way to interact with the feature service as "admin" in Pro where I can select features and delete more than one at a time?  What about Python? 

The other thing I was wondering is if I could temporarily change the Edit settings of the hosted feature layer to "Add, update, and delete features" without affecting the offline caches my field workers have locally on their devices. 

Thanks,
Jake

0 Kudos
1 Reply
KhaledHassen
Esri Contributor

Yes you can use Pro and multi select the features and delete them.

The main entry point to delete features is the REST API deleteFeatures. You can navigate to the service directory and apply your edits in the REST endpoints directly also (preferred).

http://serviceUrl/rest/services/<serviceName>/FeatureServer/0/deleteFeatures?token=aaaaa

You can delete by the list of ids such as [2,4,5, ...]. You can also specify a where clause to delete such as ObjectId > 2000. You might need to be chunk your deleted to avoid timeouts. Like deleting 200 features at a time.

>The other thing I was wondering is if I could temporarily change the Edit settings of the hosted feature layer to "Add, >update, and delete features" without affecting the offline caches my field workers have locally on their devices. 

Yes you can. This should not affect the offline map you have with the workers. Adding more capabilities are OK. Removing capability is the one that might affect your workers.

Khaled Hassen

Online Hosted Feature Service Dev Lead

0 Kudos