How to Sort repeating group from 2 different Datas

Hi Everyone,

I have a problem concerning the repeating group’ sorting. Let me explain :

I do an app were people can post and comment post.
When someone post a text, it is displayed on a repeating group.
Post can be upvote and the repeating group sort perfectly all the post regarding their number of vote (Btw I also would like to know how to limit at 1 vote per user loged ) haha
User can click on a post to access to a dedicated page to the post. In this new page, people can do comments about the post. Here is the thing : I created a new data for comment because I want them to be upvoted. So I have to set each comment as a new independant element so i can atribute a numer of vote for each comments. But the problem is : all the comments are collected on the same data base called “comment” . in the page dedicated to a post, i want to display the comment sorted by vote, but only the comment concerning that post, and not all.

For now, i can display only comments linked to the right post so each post has it own comments.
but i can’t find how to sort them by number of vote !
could you help me ?

You need to structure your database properly to get the results you want. Do some research online (outside the forum) to learn more about relational databases. It helped me tremendously; and for that matter so did learning about design off the forum as well.

Basically a relational database structure in bubble lets you “connect” two different data types to each other by referencing them as data fields.

Your example should look like

Using this relational data structure you should be able to sort all the posts in one repeating group and show their corresponding comments all in one repeating group ( depending on how you want it to look )

1 Like

Hi Boston,

I’ve found the solution of my problem just by reflexion a few hour after my post ! my solution is approximately working the same way as what you described !
Thank you so much for your help !!

@hellobrainjuice how were you able to sort the comments by their upvotes? I’m currently trying to figure it out.