Create Sequentially Numbered List in ArcGIS Dashboard

697
2
Jump to solution
02-27-2023 05:13 AM
Labels (2)
Bec
by
New Contributor III

I have a list of intersections within my dashboard and was trying to find a way to sequentially number the list using an Arcade expression, where the list would automatically update the list numbering as filters are applied to the intersection data.  So, for example, if the intersections were ordered on the total number of crashes initially, with the order going from highest to lowest, it should look like the below example:

 

  1. W Broad St and Front: 100 Total Crashes
  2. Parsons Ave and E Livingston Ave: 80 Total Crashes
  3. N High St and 5th Ave: 35 Total Crashes

If the person looking at the data, selects to look at all intersections with bicycle involved crashes, then the list will change to show only intersections with bicycle involved crashes, with the order going from highest to lowest, and the intersection numbering should reflect as in the below example:

 

  1. S High St and Williams Rd: 8 Bicycle Involved Crashes
  2. Parsons Ave and Whittier Ave: 5 Bicycle Involved Crashes
  3. E Broad St and S James Rd: 3 Bicycle Involved Crashes

I know within ArcGIS Pro you can sequentially number a table, but is usually based off of a field like the Object ID.  And it won't update the numbering if you filter for any other fields.  From what I am seeing so far, I don't think this is possible, but thought I would reach out on here and see if someone with more experience using Arcade expressions might know how to accomplish this within my dashboard.

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

You can't do it in a List, but you could easily accomplish this in a Table widget. When you enable advanced formatting on the Values tab of the widget, one of the global variables you have access to is rowindex.

jcarlson_0-1677531954133.png

You need to add a field in the Data tab to give your row index somewhere to appear, but you can then replace both its contents and the header.

No matter how you filter or sort items in this table, the row index will always apply in the order of the visible rows.

Oh, but you may want to do $rowindex + 1 since the row index is 0-based.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

You can't do it in a List, but you could easily accomplish this in a Table widget. When you enable advanced formatting on the Values tab of the widget, one of the global variables you have access to is rowindex.

jcarlson_0-1677531954133.png

You need to add a field in the Data tab to give your row index somewhere to appear, but you can then replace both its contents and the header.

No matter how you filter or sort items in this table, the row index will always apply in the order of the visible rows.

Oh, but you may want to do $rowindex + 1 since the row index is 0-based.

- Josh Carlson
Kendall County GIS
Bec
by
New Contributor III

Josh, 

This works great!  Thanks for letting me know about this option and how to get the table to work for what I needed.

0 Kudos