Sorting Dynamic Text Values with Visible Rows (Map Series)

875
5
07-29-2022 01:13 PM
Labels (1)
DanielRaleigh
New Contributor II

I'm currently using ArcGIS Pro 2.9.3 and have set up a Map Series in one of my Layout tabs. I have also set up a Dynamic Text box that presents a list of attributes for each of the polygons that are present within each Map Series page. This way, each Map Series page will produce a separate map that focuses on an area of interest of my choosing. The Dynamic Text has a Query that lists "visible rows" and accurately lists the attributes of the polygons in question separated by a comma (e.g. " ,"). However, the entries (which are integer numbers) are listed in order of OBJECTID. 

I'm curious: is there a way to sort the values within the Dynamic Text (or within a Table Frame to link to the Dynamic Frame text box) so that the values are sorted from smallest to largest? I expect that I could produce a new shapefile with the polygons in the "correct" order, but I wanted to see if there was an Arcade expression that might complete the task for this project and for others in the future. 

5 Replies
AdrianWelsh
MVP Honored Contributor

Daniel,

Have you tried utilizing the Sort option in the Map Series properties?

AdrianWelsh_0-1659369149996.png

Or is this a different situation?

 

0 Kudos
DanielRaleigh
New Contributor II

I recognize that I can sort the Map Series page list, but what I want to do is sort the values displayed in a Dynamic Text box that change based on which page is viewed. The Dynamic Text box links to polygons that are visible within each Map Series page, but I can't find a way to sort them (in this case, I'd like to sort the numerical values from smallest to largest). I've attached a screen capture which shows that the numbers in the box are not in numerical order. 

0 Kudos
AdrianWelsh
MVP Honored Contributor

That is a bit tougher. When I need to show specific values from a Map Series, I use the Page Query property:

https://pro.arcgis.com/en/pro-app/latest/help/layouts/page-queries.htm

But that does not sound like the case in this situation.

 

There does appear to be a Sort function in Arcade you could try. Here is some documentation on it:

https://developers.arcgis.com/arcade/function-reference/data_functions/#sort

 

0 Kudos
DanielRaleigh
New Contributor II

Yes, I've been fascinated and incredibly pleased with Page Query! I've incorporated page queries into several feature classes so that only specific points, lines, and polygons are displayed within the bounds of each Map Series page. It's a very handy tool that I intend to use in future projects. In this case, the page query links the Map Series page 'EC' to a specific polygon feature class so that only three polygons are displayed. The Dynamic Text box references the 3 values as "225, 159, 157", but I would like for them to display as "157, 159, 225". I would also like for the other Map Series pages to display the referenced field values in numerical order, as well. 

I have tried tinkering with the Arcade function displayed on your second link, but I confess that I'm not very adept with that language, yet. I don't think that I'm accurately defining the field/feature class in question to draw in the values that I'm hoping to sort. 

0 Kudos
TL2
by
Occasional Contributor III

Any luck?

0 Kudos