Forum Academy Marketplace Showcase Pricing Features

Can't search for users with one common interest with logged in user

Hi Bubble community!

I cannot find a solution to the following:
My users have an attribute that is a list of preferred activities (cinema, theatre, sport…).
When a user is logged in, i want to be able to show the list of users that have at least one common preferred activity with the logged in user. I’m not able to set up the right conditions in the “Do a search for” (see attached picture)

Here is the editor link. To log in a user, just click on its name.

Thanks you for any help!

Not sure it’s the most performance friendly way, but here you go:
On page load, create a custom state “user hobbies” which contains a list of all signed in user’s hobbies

The repeating group’s data source should be search for users:filtered where the constraint should be “advanced” and the expressions should be: this user’s hobbies intersect with “user hobbies”:count>1 . Also filter out the current user so that you won’t see him in the RG :slight_smile:

I hope this is what you wanted to accomplish

2 Likes

Thanks! that works.
I did not need to create a custom state. It was enough, in the repeating group’s data source filtering condition, to put: “this user’s hobbies intersect with current user hobbies: count>= 1” was enough.
Thanks a lot, i spent a few hours trying to find a solution, that is very helpful.
:grinning:

1 Like

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