# Need help with matching two lists in "Do a search"

**URL:** <https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877>\
**Category:** Need help\
**Created:** [September 1, 2025, 5:21pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877 "2025-09-01T17:21:36Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![deejay.shani](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/deejay.shani/32/108589_2.png) [@deejay.shani](https://forum.bubble.io/u/deejay.shani)\
**Post date:** [September 1, 2025, 5:21pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/1 "2025-09-01T17:21:37Z")

</div>

Hi everyone,

I am wondering if this problem can be solved with a plugin (ShiftLister, Floppy, DataJedi, Listopia, etc.)

[![Screenshot 2025-09-01 191330](https://us1.discourse-cdn.com/bubble/original/3X/e/c/ec54f58c0130a586558bbf66a6c5d09623eae59a.png)](https://us1.discourse-cdn.com/bubble/original/3X/e/c/ec54f58c0130a586558bbf66a6c5d09623eae59a.png "Screenshot 2025-09-01 191330")

[Screenshot 2025-09-01 191330808×588 26.1 KB](https://us1.discourse-cdn.com/bubble/original/3X/e/c/ec54f58c0130a586558bbf66a6c5d09623eae59a.png "Screenshot 2025-09-01 191330")

Both “List 1” and “List 2” are lists of texts.  
The “contains” constraint here does not work as both sides of the expression are lists.

_ **What I want to do is to filter for cases where List 1 field contains all texts from List 2.** _

I know I can use **:advanced** but there may be 10K+ cases in the database and :advanced will be too taxing.

Looking forward to learning the best practices for such situation.  
Cheers,  
Abdul.

---

<div class="post-metadata">

**Author:** ![akamarski](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@akamarski](https://forum.bubble.io/u/akamarski)\
**Post date:** [September 1, 2025, 5:27pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/2 "2025-09-01T17:27:13Z")

</div>

List 2 is in list 1 maybe?

I can recall we could check if something is in something else but not if something contains something else. Not sure about if it respects order tho

---

<div class="post-metadata">

**Author:** ![deejay.shani](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/deejay.shani/32/108589_2.png) [@deejay.shani](https://forum.bubble.io/u/deejay.shani)\
**Post date:** [September 1, 2025, 5:29pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/3 "2025-09-01T17:29:43Z")

</div>

Unfortunately, in “_ **Do a Search** _” we don’t get “_ **is in** _” constraint. The only options are “_ **Contains** _” , “_ **Doesn’t** _ _ **Contain** _” and empty/isnt empty. Contains only matches the first item in the list.

---

<div class="post-metadata">

**Author:** ![rpetribu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rpetribu/32/90852_2.png) [@rpetribu](https://forum.bubble.io/u/rpetribu)\
**Post date:** [September 1, 2025, 7:21pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/4 "2025-09-01T19:21:09Z")

</div>

**List1** Intersect with **List2** :count is **List2** :count

It should work! It will be true only if all items in list 2 are contained in list 1

---

<div class="post-metadata">

**Author:** ![deejay.shani](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/deejay.shani/32/108589_2.png) [@deejay.shani](https://forum.bubble.io/u/deejay.shani)\
**Post date:** [September 1, 2025, 7:29pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/5 "2025-09-01T19:29:04Z")

</div>

We do not get that option in the “Do a Search” parameters.

> [@deejay.shani](#):
>
> Unfortunately, in “_ **Do a Search** _” we don’t get “_ **is in** _” constraint. The only options are “_ **Contains** _” , “_ **Doesn’t** _ _ **Contain** _” and empty/isnt empty. Contains only matches the first item in the list.

---

<div class="post-metadata">

**Author:** ![rpetribu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rpetribu/32/90852_2.png) [@rpetribu](https://forum.bubble.io/u/rpetribu)\
**Post date:** [September 1, 2025, 7:42pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/7 "2025-09-01T19:42:53Z")

</div>

Oh… now I understood what you are trying to do … A many to many search!

---

<div class="post-metadata">

**Author:** ![deejay.shani](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/deejay.shani/32/108589_2.png) [@deejay.shani](https://forum.bubble.io/u/deejay.shani)\
**Post date:** [September 1, 2025, 7:50pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/8 "2025-09-01T19:50:08Z")

</div>

Yes, a many to many match within a search.

---

<div class="post-metadata">

**Author:** ![rpetribu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rpetribu/32/90852_2.png) [@rpetribu](https://forum.bubble.io/u/rpetribu)\
**Post date:** [September 1, 2025, 8:05pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/9 "2025-09-01T20:05:05Z")

</div>

Ok, so I came to one simple solution…

If you could have, inside each “case” the same list but also the representation of this list as a text, you can use the “contains keyword(s)” to make the Search.

Here is what I have built…

> **[Bubble - Visual Programming](https://internal-test-ez.bubbleapps.io/version-test)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

Editor [here](https://bubble.io/page?id=internal-test-ez&tab=Design&name=index&type=page&elements=bTGYf)

The only thing you need to do is, whenever an item is added or removed from your list, you update the string that represents that list.

---

<div class="post-metadata">

**Author:** ![kibermaks](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kibermaks/32/253375_2.png) [@kibermaks](https://forum.bubble.io/u/kibermaks)\
**Post date:** [September 2, 2025, 10:32am UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/10 "2025-09-02T10:32:22Z")

</div>

You can do this with client side :filtered operator after “Do a search for”. It supports …intersect, though it will be executed on client side.

---

<div class="post-metadata">

**Author:** ![kibermaks](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kibermaks/32/253375_2.png) [@kibermaks](https://forum.bubble.io/u/kibermaks)\
**Post date:** [September 2, 2025, 10:40am UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/11 "2025-09-02T10:40:00Z")

</div>

Sorry, just read your original post to the end, and seems you are aware of this. 🙂  
I doubt that any plugin can solve this as all of them work with client data not with raw server db data.

But if your request is to check whether there is exact match of all strings(not intersect of some): I think you can have one workaround that should actually work on server.  
You can have extra field in db that stores all list items as sorted alphabetically joined text, e.g. “ABC,BCD,CDE…”. For Thing 2 list you can have the same.  
And after that **“Do a search for…”** can just have Thing1’s joinedList is Thing2’s joinedList

---

<div class="post-metadata">

**Author:** ![Newed](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/newed/32/262530_2.png) [@Newed](https://forum.bubble.io/u/Newed)\
**Post date:** [September 2, 2025, 10:54am UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/12 "2025-09-02T10:54:39Z")

</div>

This is a current limitation when we need to use comparisons (filters) of this type, applying constraints at server-level.

I think things like this have been discussed in the past and are recurring. So, if the operators discussed in this thread below were added, it would be very useful. Take the opportunity to vote on this request in the ideaboard.

But the approach used by @rpetribu works well.

> [@Normal Search Constraints on List Fields have a Contains List comparative operator](https://forum.bubble.io/t/normal-search-constraints-on-list-fields-have-a-contains-list-comparative-operator/377633):
>
> When we are using constraints in a search and the field we are going to add a constraint to is a list, that field should have more than just the contains, doesn’t contain, is empty or isn’t empty comparatives. There SHOULD be also a Contains List comparative and also a doesn’t Contains List comparative. We should not have to use Advanced Filters for this. [Please Upvote HERE](https://bubble.io/ideaboard?idea=1754297028158x752970699106680800) if you think Bubble should update this.

---

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [September 2, 2025, 11:19am UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/13 "2025-09-02T11:19:20Z")

</div>

Please upvote the idea on the idea board.

> [@Normal Search Constraints on List Fields have a Contains List comparative operator](https://forum.bubble.io/t/normal-search-constraints-on-list-fields-have-a-contains-list-comparative-operator/377633/1):
>
> [Please Upvote HERE](https://bubble.io/ideaboard?idea=1754297028158x752970699106680800) if you think Bubble should update this.

The suggestions of a field with a list of text to be a replica of the list of ‘things’ works well enough. Just remember the tradeoffs associated and the need to keep them in sync, neither needs to be a deal breaker.

---

<div class="post-metadata">

**Author:** ![akamarski](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@akamarski](https://forum.bubble.io/u/akamarski)\
**Post date:** [September 2, 2025, 5:13pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/14 "2025-09-02T17:13:05Z")

</div>

Shame that after all, Bubble is Postgres and we should be able to use all of it

---

<div class="post-metadata">

**Author:** ![deejay.shani](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/deejay.shani/32/108589_2.png) [@deejay.shani](https://forum.bubble.io/u/deejay.shani)\
**Post date:** [September 3, 2025, 2:48pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/15 "2025-09-03T14:48:19Z")

</div>

Hi Rafael,  
Thank you for the great advice and taking the time to build out the demo. It works great.  
Sadly Working on complex ideas in Bubble requires us to maintain a whole database of workarounds. This is a nice addition to that database for me 😀❤

---

<div class="post-metadata">

**Author:** ![Lumyna](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/lumyna/32/185968_2.png) [@Lumyna](https://forum.bubble.io/u/Lumyna)\
**Post date:** [October 15, 2025, 9:59pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/16 "2025-10-15T21:59:42Z")

</div>

Hey @rpetribu I followed your solution and it works great when the result is what the OP expected.

> **List 1** field _contains all texts_ from **List 2**

But I was just trying to use this in a different approach and ran into another limitation.

Basically something like.

> **List 1** field contains at least one option (text) from **List 2**

Imagine I have a list of products:

- Product 1
- Product 2
- Product 3
- Product 4

And each product has a list of categories.

- Product 1

- Product 2

- Product 3

- Product 4

Even if I create a simple text field to store this as a “list of texts”, and have a multi dropdown as a filter where I select the following options, I’ll get the following result for each case:

# Case 1:

**Options selected** : Category A  
**Products returned** : Product 1, Product 2, Product 4

# Case 2:

**Options selected** : Category A, Category B  
**Products returned** : Product 1

In Case 2, I wanted to return all products that contain one of the two selected options. In this case, all products should be returned, since they all have either **Category A** or **Category B.**

Here I’m giving an example with few options, which in extreme cases could be solved with an intersect with for each option. But this becomes impractical when using dozens of options as filter.

Do you or anyone else have any ideas on how to approach these cases?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![rpetribu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rpetribu/32/90852_2.png) [@rpetribu](https://forum.bubble.io/u/rpetribu)\
**Post date:** [October 16, 2025, 1:31pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/17 "2025-10-16T13:31:05Z")

</div>

Hey @Lumyna 👋

You can achieve this without workarounds…

Do a Search for Procucts  
Where  
Advanced: This Products Category’s intersect with List 1 : first item is not empty

By doing this, you will return all products that have a list of categories that, when compared to the categories in list1, have at least one similar item.

---

<div class="post-metadata">

**Author:** ![Lumyna](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/lumyna/32/185968_2.png) [@Lumyna](https://forum.bubble.io/u/Lumyna)\
**Post date:** [October 27, 2025, 11:41am UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/18 "2025-10-27T11:41:42Z")

</div>

But when using advanced filtering, this will be done on the client side, correct? Is there any way to do this on the server side since the amount of data is large?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [November 10, 2025, 5:22pm UTC](https://forum.bubble.io/t/need-help-with-matching-two-lists-in-do-a-search/379877/19 "2025-11-10T17:22:34Z")

</div>

Closed on November 10, 2025, 5:22pm UTC

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