Filters for Upvote

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

  1. Popular
  2. Latest

I want the RG to sort by upvote counts on clicking Popular
I want RG to sort by created date on clicking Latest

Please help

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.

Hope this helps.

Best…
Mike

I have figured that out but I want to acheive something similar to this

How do I have 2 different sorting options to work on clicks?

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.

Best…
Mike

1 Like

Bro, that worked.
Thanks a lot :heart::heart:

1 Like

If Bubble paid you a quarter for every successful forum help you’ve provided, you’d be able to retire by now.

2 Likes

Too kind, @SerPounce, too kind… and I’m still not playing cards with you anytime soon!

2 Likes

How about Old Maid?

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.