I noticed today that, in a deck view, group headings based on a ref column inappropriately sort by the literal reference value (e.g., an ID) and not by the displayed value, which is appropriately from the parent table's column that is designated as the label. I never noticed this before, and wonder whether:
Anyway, if it's not a bug, can anyone provide guidance regarding how to achieve sorting by the displayed values instead of the underlying ID values?
Group headings in the app's UI - notice that "List 4" precedes "List 3" in the display
Source data - notice that the ID for "List 4" alphabetically precedes the ID for "List 3"
"Group by" settings for the view - notice that the List ID field is set to sort in ascending order
Solved! Go to Solution.
This has been an issue from day one. As you know, Ref columns store the row key. For display, AppSheet will show the column marked as "Label" in the referenced table. However, any functions will operate on the actual value in the column - including sorting. I believe there are a couple of Feature Ideas recommending to use the Label for Grouping. Feel free to add your comments to those.
As a workaround, create column in the table you are Grouping to pull in the Label value from the Ref column.
Note: Another pain point with Grouping is that there is no way to elegantly specify a custom Group sort order. If you want the Groups in a non-alphabetical order (or non-numerical order) but rather in an order you specify, you would need to add something to the displayed value to force the order you wish. E.g. { 1-List 2, 2-List 3, 3-List 1, 4-List 4 }... or maybe {a-List 2, b-List 3, c-List 1, d-List 4}
User | Count |
---|---|
15 | |
14 | |
8 | |
7 | |
4 |