I am interested in the ability to only show current location using the location tracking. Is this something that has been updated since this thread was started in May?
The following expressions does the trick for me
In ago-assistant:
"definitionExpression": "\"CreationDate\" IN (SELECT MAX (\"CreationDate\") FROM db_<the_number>.user_<the_number>.<feature_service_name>_<layer_name> GROUP BY \"Creator\")"
Thanks to Leah for the solution.
Where do you add this script? I keep getting an error that the JSON is invalid no matter where I add this.
The easiest way to figure this out is to add a filter in the web map to the layer that you plan to add the query to. Then go back to the JSON and look for that query in the JSON by finding "definitionExpression".
How do you find feature service No and user number. That is the key I am missing. Also I know the layer name but not the feature service name? Is there somewhere to get all this information? I have scoured the Json file but have not found anything the looks like what I have seen from others.
Thank you
Jacob
Figured it out had to go through the Admin definition file.
Would this approach work in Portal for ArcGIS?
Cant seem to get it working in 10.4.1
Getting a number of errors in console which makes me suspect that it relates to the 'allow standard SQL queries' option which only appears to be available within ArcGIS Online and not Portal admin security settings
Although it won't display a location if a person is no longer being tracked, there is now a way to filter "in the last" minute through a webmap. This may cater for some use cases. The definitionExpression that is being used is:
EditDate BETWEEN CURRENT_TIMESTAMP - 0.0006944444444444445 AND CURRENT_TIMESTAMP
It does not require the "Allow only standard SQL queries" setting to be turned off. The above definitionExpression is used for the filter below:
The minimum filter you can do through the ArcGIS Online Map Viewer is in the last 1 minute, but you could probably alter that via ArcGIS Online Admin Assistant if necessary.