Batch Delete Survey Entries from Non-Hosted Feature Layer

244
5
Jump to solution
a week ago
emoreno
New Contributor III

Hello Esri community!

I received a request from a team in my organization to delete old Survey123 data, which was published off a non-hosted feature service in Enterprise 10.9.1. This survey is connected to many dashboards and web apps in Portal that were configured long before I started at this org, and I would like to avoid having to reconfigure them if possible. I've looked at the following documentation to see the best way of batch deleting this data, 

How To: Delete Survey Records on the ArcGIS Survey123 Website (esri.com)

How To: Batch Delete Features from an ArcGIS Online Hosted Feature Layer (esri.com)

How To: Batch Delete Features from a Hosted Feature Layer in ArcGIS Pro (esri.com)

but given that it is not a hosted feature layer these methods won't work. Additionally, I am unable to export the data for the same reason. Is there a way to batch delete the data from this survey layer or any documentation relating to this given the circumstances? Any help is appreciated, thank you!

emoreno_2-1714164676343.png

 

0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @emoreno

If your feature service is not hosted it should be coming from an Enterprise Geodatabase within your organization. You can pull the feature class from the Enterprise Geodatabase into Pro and delete the features from the attribute table. Any features added/deleted are immediately reflected in the feature service. 

Thank you,
Zach

View solution in original post

5 Replies
jcarlson
MVP Esteemed Contributor

Use the REST endpoint, maybe? Go to https://your-portal/server/rest/services/Hosted/your-service/0/deleteFeatures and then use the where option to specify what data you want to delete. If it's just all of it, put "1=1" in the box. If it's from a certain date, you can identify the highest objectid of the old data and put "objectid <= N", N being that objectid.

- Josh Carlson
Kendall County GIS
0 Kudos
emoreno
New Contributor III

Thank you for the reply Josh,

We did see documentation on this process and it was the first thing we tried. While it did remove data on the back end of the survey, the feature class still was still showing data for some reason. We stopped and restarted services to see if it would remove the data from the feature class, but instead it added the removed data back to the survey. Very strange. I appreciate your help nonetheless, thank you!

0 Kudos
jcarlson
MVP Esteemed Contributor

Interesting! Maybe something to do with dataset versioning? Regardless, I'm glad you found the solution!

- Josh Carlson
Kendall County GIS
0 Kudos
ZacharySutherby
Esri Regular Contributor

Hello @emoreno

If your feature service is not hosted it should be coming from an Enterprise Geodatabase within your organization. You can pull the feature class from the Enterprise Geodatabase into Pro and delete the features from the attribute table. Any features added/deleted are immediately reflected in the feature service. 

Thank you,
Zach
emoreno
New Contributor III

Thank you sir, this worked!

0 Kudos