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)
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.
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.
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.