Forum Academy Marketplace Showcase Pricing Features

This problem with searching the database is killing me! Please help

Hi all,

I have tried and tried and tried to achieve what I am trying to achieve, but can’t seem to find a way to do it.

My site is going to be a searchable database, but rather than populating the search results (repeating group) with users when they match all of the data fields entered by the searcher, I want the default to be all users who then are discounted each time a data field is selected that they don’t match. For example…

10 users (let’s say a,b,c,d,e,f,g,h,i,j)
10 data fields (let’s say 1,2,3,4,5,6,7,8,9,10)

User a has all data fields assigned - so 1-10
User b has 1-9 assigned
User c has 1-8 assigned
… and so on, until
User j has only data field 1 assigned

Someone searching may first, for example, select data field 1, and would be shown (in the repeating group) all users, a-j, because all of them have data field 1 in their profiles.

Then the searcher may select data field 6, and this would reduce the matched users to a-e, as they are the only ones with both data field 1 and data field 6 in their profile.

Then the searcher may select, for example, data field 9, and this would reduce the users shown in the repeating group to just User a and User b, because they are the only two users who have all three selected data field in their profile.

I really can’t figure out how to do this. If anyone knows a way, please let me know. You would, at the very least, be stopping me pulling my hair out!

Thanks in advance

Andrew

Hi,

The best way to get help is to put an example in the forum app, or make your app (or a copy) public.

It is hard to know what you mean by “has all data fields assigned” “have data field 1 in their profiles.” … these are not Bubble terms.

What are these fields ? How are they set up ? What does “assigned” mean in bubble terms ?

Without understanding what you are trying to achieve it is a little difficult without being clearer.

My guess is that you are trying to set the data up with 10 different fields on the User ? I think a better way would be to have a single array with your “fields” in it. So user a would be <1><2>…<10> and user j would only have a single entry <1>.

Then you could use the “contains” constraint in your bubble search.

3 Likes