How do i sort by upvotes in bubble reddit template

I have built the bubble Reddit template following these instructions https://bubble.io/blog/build-reddit-clone-no-code/ but I can’t work out how to calculate and then sort the posts by upvote/downvote?
The instructions don’t include how to create this workflow or calculation once I set up the upvote and downvote?
Hoping this is pretty easy piece I’m missing someone can help me with.

@cyriltdixon

You can just have a field Upvotes of type number in your Post data type
In your workflows, add +1 when the post receives an upvote. You can also subtract -1 when the post receives a downvote
Then you can simply sort your Posts RG by Upvotes descending = yes

Hope that helps

Also create a user field and add the current user to the list of users who have upvoted/downvoted. Set up a conditional statement so that the same user cannot upvote or downvote more than once.

Thanks Sharma, how do i set up a conditional statement?

I am not in front of my laptop right now, but you’ll have a field Upvoters of type list of users. On the workflow which triggers the upvote, add only when Current cell’s Upvoters doesn’t contain Current user

1 Like

thanks, yep. got it