Sorting entities for use in choice lists

1. What is the issue? Please be detailed.
I uploaded a list of locations to an entity list, pre sorted in the order I wished the choices to display.
The list in Central shows row 1 at the bottom as entry 1, and the last row at the top, so the file was read from top to bottom.

When I use this entity list in a Select, the order is reversed, displaying them in the order they were added to the entity list, most recent first.

I need the ability to sort choices, be it A-Z / elevation / priority / incomplete first / smallest to largest (for proper rendering of polygons on map to still allow selection without blocking) or any other method to aid in usability. Currently with CSV choice lists I generate the list in the preferred order and then create the file.

Knowing how they are processed means reverse sorting the list before uploading will work, but this doesn't work for items created at different times or where the preferred order will change as the survey progresses.

I can't see how the choices can be ordered based on any value in the entity list, there's nothing in the docs or on the forum that I could turn up on sorting entities or choices, only that they are now sorted by creation order:

3 Likes

Being able to sort a choice list populated by entities would also be something that I'd be interested in for the linguistic example explained here: Retrieving Dynamic Media from Entity - #9 by Tyler_Depke

1 Like

You can see some prior discussion of sort functions at Support for XForm Sort Expression - #3 by LN

We're currently working on supporting offline Entities and as we design how Entities are stored on-device for offline creation and updates, we are considering an eventual sorting requirement.