Be Able to Sort a Repeating Region By Multiple Column Values

I’ve read a database table called contacts into a Data Store.

I want to display them sorted in a repeating group, first by the field is_deleted, then by the field id, so the region may look like this:

id  name
====================
5   Fred
2   John
1   Jane
6   Mark (Deleted)
4   Bert (Deleted)

So I want to be able to do something like:

.sort(is_deleted).sort(id.reverse())

This is a feature request to be able to have:

  1. Multiple sort column values per repeating region.
  2. To be able to select reverse for any one of those columns.

This feels especially important now we have the Data Store element. This kind of sorting is possible when using a Server Action, but with the Data Store, the sort ability needs to come back down to the point of display, i.e. the Repeating Group.

Best wishes,
Antony.

Where are your records coming from and how are you displaying them on your page?

They are from a Data Store. So far, the repeating group is like this:

<div dmx-repeat:rg_contacts_searched="all_contacts.data.where(`is_a_test`, in_test_mode.value, &quot;==&quot;).where(`is_searched`, 1, &quot;==&quot;).sort(id).reverse()">
   <p>{{first_name}} {{last_name}}</p>
</div>

So I want to say something like this to do the sorting:

.sort(is_deleted).sort(id.reverse())

But that doesn’t seem to work…

I see, yes you can only pass one sort parameter.