Select to view content in your preferred language

Display the latest Polygon Created on ExB app

456
4
05-06-2025 04:00 AM
galiGIS
Emerging Contributor

Hello,

I'm working on an ExB app that allows users to create polygons. My aim is to always display the latest polygon created by users, regardless of who created it. I have been doing some research and found the following thread that suggests it is possible using View layers, but I can't get it to work as still shows all the polygons (instead of the latest):

https://community.esri.com/t5/arcgis-online-documents/display-latest-feature-in-a-feature-service/ta...

I have tried filters already but the 'creation_date' expressions doesn't allow me to pick 'last' at all.

Has anyone been able to display always the latest polygon in a ExB app?

Any idea / help more than welcome

I'm on ArcGIS Enterprise Version: 11.3.0 (build 51575)

 

 

0 Kudos
4 Replies
SaraBellchamber1
Emerging Contributor

I haven't tried this but just a thought... what if you created an expression on the layer symbology that only grabbed the Max Object ID?  Theoretically the latest polygon will have a higher number than the poly before it.

galiGIS
Emerging Contributor

Thanks @SaraBellchamber1 Unfortunately AGOL or Portal filters do not evaluate expressions like maxOBJECTID or support subqueries.

0 Kudos
FarmersBranchBrian
Occasional Contributor

You are correct in that you can't "Filter" in such a way that allows you to only display the latest record.  The only way I've ever found to do this is either with ArcGIS Enterprise to have more fine control over the published service or, as you seem to have located, adding a "TopFilter" to a view definition.

The article you linked to is one of a few that show how to do this step by step but I do admit it is extremely finicky to get working.  If you need assistance, please feel free to reach out as I have implemented this a few times and have learned a few of the "gotchas" that you might be running in to.

FarmersBranchBrian
Occasional Contributor

Upon further examination, I have replicated this issue in ArcGIS Enterprise (Version 10.9.1).  It may be that this trick is an AGOL exclusive one due to an underlying database issue.  I'm sure there is some way to do it in Enterprise but am not sure what changes to the syntax would be required.  I'll reach out to some others I know for additional insight.

For clarity, my test was with a Hosted Feature Layer (in the Data Store, not published by reference from an Enterprise Geodatabase).