HOW TO

Delete tracks from the location sharing layer with ArcGIS REST API

Last Published: December 6, 2023

Summary

ArcGIS Tracker is used to track the movement of mobile users. At times, the locations are deleted to reset the movement of the users or remove unnecessary tracks from the record. However, location sharing layers do not indicate the Delete Features capability in the feature layer definition. In ArcGIS Online, this is accomplished via ArcGIS REST API using the Delete Features operation. The workflow to delete tracks from the location sharing layer using the Delete Features operation in ArcGIS REST API is demonstrated in this article.

Procedure

Note:
The ability to delete tracks is restricted to administrators.
Note:
Deleting individual tracks directly is not supported in ArcGIS Online. Performing the following workflow deletes the user's tracks entirely. 
Note: 
Esri recommends creating a backup of the data by exporting the location sharing layer as a shapefile or CSV file before deleting the track views. Refer to ArcGIS Online: Export data from hosted feature layers for further instructions.
  1. Log in to ArcGIS Online and click Groups > My Groups.
  2. Browse to and click the group of the track sharing.
  3. Under Recently added content or Featured group content, browse to and click the hosted feature layer.
  4. On the item details page, scroll down to the bottom of the page. In the URL section, click View.
The View button in the URL section.
  1. In the ArcGIS REST Services Directory, under Layers, right-click Tracks and select Open link in new tab.
The Tracks option under Layers.
  1. In the URL of the new tab generated, insert /deleteFeatures/ in between ‘0’ and the ‘?token’ section. The image below shows the deleteFeatures parameter appended to the URL.
The 'deleteFeatures' appended in the URL.
  1. On the Delete Features: Tracks (ID: 0) page, configure the Delete Features operation.
    1. For Where, type created_user in ('<username>').
Note:
For more information on the clauses used in this workflow, refer to ArcGIS Online: Deleting tracks.
  1. For Rollback on Failure, click False.
  2. For Return Delete Results, click False.
  3. For ASync, click True.
  4. Click Delete Features.
The Delete Features parameters configured on the Delete Features page.
  1. Click the link in statusURL.
The link for statusURL.

When 'Completed' is returned in Status, the tracks are deleted from the location sharing layer.

The Completed message displayed for Status in the Delete Features Status page.

Article ID:000028200

Software:
  • ArcGIS Tracker
  • ArcGIS Online
  • ArcGIS REST API

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic