Dynamic source repeating groups

Hi there, I’m building an app that offer the users possibility to register their gender/sexual orientation and find other similar ppl among the other users.

Considering that I have LGBTQIA possibilities (Lesbian, Gays, Bi, Trans, Queer, Inter, Assexual), how could I build a repeating group that shows only the options that a user has choosen?

For example, the source has to be dynamic enough to show only “Lesbians”, “Bi” and “Trans” if I choose so…

I actually have a version with male and female and I’ve made a conditional for the repeating group where I change the source depending on their options but that was easy since there are only 3 options (M, F, M+F)

With all those possibilities it’s a damn work to create all those conditionals.

Is there an easier way that I’m missing out?

Hi @viladosite,

An easier way to do this might be to have a field called “preferences” in your db that is a list of texts, and to store a user’s preference values in that list. So instead of checking to see a “yes/no” value for 7 different fields, you’re checking to see if a text exists within a list of texts. Let me know if this makes sense :wink:

Jacob
Need help with Bubble? https://www.tekademy.co/

1 Like

Thank you for your reply Jacob.

Yeah, it makes sense but how could I set this on source? I mean, I have a field as your said, a list of texts. Now I just don’t know how to set a constraint on repeating group source to get the possible options stored in this field.

How could I set it to get like…contain “trans” or “bi” or “lesb”…directly from what the user has chosen? It’s enough to set it to get the value from that field from current user?

Seems like I get it…

Where “user_sexo” is the field where the user say what’s his classification and “current users pref_sexo” is the texts list where he choose what he wanna see.

Thats it?

Yeah, that looks right. Is it working for you?

I’m gonna test it…
I’ll have to do some db and workflow changes for that…

I’ll reply with what I find but thank you in advance for the help :upside_down_face: :+1:

1 Like

Just posting a feedback on how I’ve solved this based on @jacobgershkovich idea.

I’ve created a field called “user_genero”(1) where the user chooses his own genre ( only one option based on a options list) and another field called “pref_genero”(2) where he choose the ones (this field is a list, so he can choose more than one) he would like to see.

To show it on feed, I’ve used a repeating group where I’ve added a constrain so the searched users had to have his own choosed genre on the current user list of preferences.

Thank you @jacobgershkovich :slight_smile:

1 Like

Happy this worked out for you @viladosite. Great stuff!

2 Likes