Can someone give me an example Arcade expression that returns the first five (or whatever #) of records?
Thanks!
You can use the Top function to do this. The example in the documentation shows how to get the top 5 features with the highest population with the addition of the OrderBy function.
Top( OrderBy($layer, 'POPULATION DESC'), 5 )
I feel like I'm missing an important step I'm hoping someone can help point me in the right direction.
I'm using the new map viewer in ArcGIS Enterprise Version 10.9.1
In the expression builder for the pop up I've included code just like the above solution. I test it in the expression builder and it looks fine in that it returns the number of records sorted the way I want. I then save the expression.
When I test my change on my web maps however, the pop ups continue to show all the records not just the top ones. Should I be referencing the expression in the body of the pop up text? I tried that but it doesn't do anything, or I'm just not doing it correctly. Thank You!
Hi @JoePlattner ,
Did you get this to work?
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.