[SOLVED] Advanced search: list contains multiple items

I want to do the next search:

Cars (items) that have Color (field) equal to ‘red’ or ‘green’ or ‘blue’ (this list of texts I get from e.g. current user’s field).

So far I found the next workaround:
Cars that have Color equal to ‘red’ merged with Cars that have Color equal to ‘green’ merged with Cars that have Color equal to ‘blue’, but this doesn’t seem good if the list of colors will become big.

p.s. If I could use ‘OR’ when specifying constraints in ‘Search for items’ that would solve the problem.

1 Like

Try a constraint on the search “Color is in MyListOfColors”

From the reference: Constraint type ‘in’ or ‘not in’ to test whether the thing’s field is in a list or not.

Since type of field Color is List of Texts I can’t use ‘is in’ for it.
I can use only: contains, doesn’t contain, is empty, isn’t empty.

So right now it looks like:
Colors contains Search for Cars:converted to list’s Colors:item #1 —> this is for red color. Similar for other colors.

Try this in the repeating group of Cars:


Choose “is in” and then put in your list of colours, adjusting spelling to your taste, haha.

Thanks! Actually I tried that already. When my Colors were just a text field (not list) I was able to use ‘is in’ and then constructing the list of colors by concatenating similar text fields (colors of other cars) and then converting that to a list. But it didn’t work.

That’s why I decided to make Colors a list of texts. So now at least using dumb workaround I’m able to achieve my result. Better than nothing though :slight_smile:

Maybe this https://testy11.bubbleapps.io/version-test/cars?debug_mode=true ?

2 Likes

or maybe this is better
https://testy11.bubbleapps.io/version-test/cars2?debug_mode=true

1 Like

Thank you so much friend for creating this!
Helped me a lot, especially first one (cars).
Really appreciate!

Since the example that created the solution, is not longer available there is not way of knowing what was the solution for this post.

Could you please provide the solution?

I have the same problem because I am trying to look for matching values in a list of search tags inside a record.

8 Likes

Anyone on this please??

I also need this solution. Who can help?
@zergaka @mente12 ?

I submitted an idea related to this:

We need that feature as well…

Hi CM1

Your link with the solution is not loading. Can you repost as I think it would help me with my current project.

Thanks

bump!

Your link is not working. can you please provide another one.

Bump!! This feature is crucial to what I’m building

1 Like

Bump. We need this desperatly. :slight_smile: