Edit:
My bubble has been burst by @Atom Thanks for the link:
Context:
I discovered a new method for sorting elements within groups and sorting the groups themselves:
Create a Template Column: Combine the columns you want to sort by into a single template. For example: GroupName (a number if you want to control the order of groups) - ItemName.
Use the Template Column for Sorting: Apply the template column in the “Sort Group By” option of your collection.
This approach simplifies managing both the group order and the order of elements within each group.
Yeah, I’ve done this a few times. Just need to be careful if using numbers in your template because numbers will be sorted as text instead of numerically (ex. 10 comes before 9 because 1 is smaller than 9 alphabetically, whereas 09 and 10 would sort correctly). When using numbers, which are converted to text, you need to zero pad them so they are all the same length, so they will sort correctly.
The other thing to watch out for is to make sure the character used as your delimiter comes after any other character in Unicode order. Otherwise it may sort incorrectly. I think a dash (-) is fine but I’ve never taken the time to look over the Unicode ordering of characters to figure out which is best.
In most cases it should work fine, but those are a couple of things to look out for.