[Solved] Creating a 'Sort By' Filter

I’m trying to guide users to choose from four dropdown menu options to sort a Repeating Group list:

Option 1: Created date (newest to oldest)
Option 2: Created date (oldest to newest)
Option 3: Number of votes (highest to lowest)
Option 4: Number of votes (lowest to highest)

Dropdown Menu:
Screenshot 2023-12-27 at 9.39.39 PM

Repeating Group:

Selecting an option should immediately update the list’s order.

How can I implement a function like this?

I am using a solution, that when the dropdown item is selected it changes the custom state. And when the custom state is changed a different search is performed (conditional on the regular search, deata source) - having the same parameters, just sorting by other element.

If there is any other way - please tell me :slight_smile:

I’ll try this.

Thanks for the suggestion.

I’d use an option set for this…

For each option, as well as the Display, add a text attributes for sort field, and populate that with the exact name of the field from the database, and a ‘Descending’ field, of type yes/no.

Then add a dropdown with that option set as its source.

Then just set the sort on your search to ‘Change which field’, set the field name to the dropdown’s value’s display, and the descending to the dropdown’s value’s descending.

Hi I just figure out this problem before

1st create an option set and choose dynamic choices using options sets in droopdown

2nd Goto conditional format of the repeating group and do a condition

image

1 Like

Adding on to your solution.

I set the data source to ‘Search for Products’ for each condition and from there I modified the repeating group’s layout using the ‘sort by’ field. If there’s a more efficient method, please let me know.