Select to view content in your preferred language

Deleting Data from Location Tracking Feature Layer

3833
4
Jump to solution
11-18-2014 09:17 AM
TonyGroeneveld
Deactivated User

I have a location tracking feature layer that I am using in Collector to track the field staff as they do their data collection.  After several days of data collection this layer gets lots of points.  We are only interested in the data on the day that the collection is being done.  That is we don't want to see data from the previous days of collection.  Is there any way to do a mass delete of data from this feature layer rather than letting it continue to grow?

I can delete an individual point but what I want is to be able to delete all rows where CreationDate < today.

0 Kudos
1 Solution

Accepted Solutions
RussRoberts
Esri Notable Contributor

You could setup a script or do this manually and hit the REST endpoint for the service. So you could just go into the REST for the service, go into delete features and for the Where query you can put in something in like this CreationDate < '2014-11-17 08:00:00' and that should blow away all features before that date.

View solution in original post

0 Kudos
4 Replies
GISSupport3
Frequent Contributor

G'day Tony

There are a few options. You won't want to archive the data for audit purposes?

Either way, some options are:

- use a definition query on the service to only display the last XX hours

   * manually archive data every XX

- have a script / program run daily to delete records

- have a script / program run daily to move 'live' records to archive database

0 Kudos
RussRoberts
Esri Notable Contributor

You could setup a script or do this manually and hit the REST endpoint for the service. So you could just go into the REST for the service, go into delete features and for the Where query you can put in something in like this CreationDate < '2014-11-17 08:00:00' and that should blow away all features before that date.

0 Kudos
TonyGroeneveld
Deactivated User

Right, I'm still getting used to the whole services and how you use them.  Still thinking in terms of geodatabase data.  I'm guessing the 1,000 service record limit would be an issue and you would have to batch the deletes if you had more than 1,000 records.

Is there a way to make a feature class in SDE, publish it and make that your layer for tracking?  How do you identify the layer as a tracking layer so that ArcGIS Online map recognizes as such?

0 Kudos
RussRoberts
Esri Notable Contributor

Currently you cannot expose a service coming from an on-prem service as a location tracking layer in AGOL. You can do this through Portal because you can access the rest page for your service items.

0 Kudos