Hi, I’m adding an Upvote function to the RG. How can make use of buttons or dropdowns to sort it either by Popularity ( Count of upvotes ) or by latest ( created date )
I’m planning to have 2 button side by side
Popular
Latest
I want the RG to sort by upvote counts on clicking Popular
I want RG to sort by created date on clicking Latest
Hi there, @sanjuujosephh… I have done something very similar in one of my apps, and I used a dropdown that sits right above the repeating group. Then, do a Sort by on the repeating group’s Data source, and select Change which field... for the Sort by option. At that point, you will be able to select the dropdown as the dynamic field on which to sort, and that should get you down the path to making this work.
You asked how you could make use of buttons or dropdowns to make it work, so it was implied that you hadn’t figured that out already. Great that you did, though, and if you had mentioned that, my response would have been different.
Anyway, if you want to sort on a click, you will want to make use of the Element Actions >> Repeating Group >> Display list option in the workflow, and add the :sorted option to the end of the Data source.