# Filter or search constraint by a list

**URL:** <https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854>\
**Category:** Need help\
**Created:** [February 10, 2024, 11:56am UTC](https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854 "2024-02-10T11:56:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![phan.personal](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@phan.personal](https://forum.bubble.io/u/phan.personal)\
**Post date:** [February 10, 2024, 11:56am UTC](https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854/1 "2024-02-10T11:56:30Z")

</div>

Hi Bubbler,

Please help, I am trying do a filtered search as follow:

I have a datatype call Relationship which contain a list of another datatype call brokers.

I want the ability to filter the list of relationship that contain any brokers that is in a list of brokers that the user will select.

The advance filter contain list doesn’t work correctly because if you have two brokers in a list it will only shows relationships that contain exactly the two brokers. Which is not what I want, it should show any relationships that contain any of the two brokers.

Anyone know how I can implement this without resorting to recursively searching for relationships for each brokers and intersecting it?

Thanks

Ty

---

<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:** [February 10, 2024, 5:39pm UTC](https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854/2 "2024-02-10T17:39:42Z")

</div>

could you use the advanced filter with the operator ‘intersects with’ and the count be 1 so that only at least one of the brokers in the selected brokers list is in the data field list of brokers of a Relationship?

---

<div class="post-metadata">

**Author:** ![phan.personal](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@phan.personal](https://forum.bubble.io/u/phan.personal)\
**Post date:** [February 11, 2024, 12:14am UTC](https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854/3 "2024-02-11T00:14:19Z")

</div>

Thanks for your reply.

Unfortunately that doesn’t work either. Surely there’s a way to filter more efficiently with bubble.

The only way I could think of to make this work is to store relationships in the the broker data field too. then do an intersect between the two lists, but that’s not very efficient.

---

<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:** [February 11, 2024, 5:37am UTC](https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854/4 "2024-02-11T05:37:22Z")

</div>

> [@phan.personal](#):
>
> Unfortunately that doesn’t work either.

Yes it does

> **[Bubble Editor - Free-tutorials](https://bubble.io/page?type=page&name=intersect&id=free-tutorials&tab=tabs-1)**
>
> 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.

username=username  
password=password

---

<div class="post-metadata">

**Author:** ![phan.personal](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@phan.personal](https://forum.bubble.io/u/phan.personal)\
**Post date:** [February 11, 2024, 9:18am UTC](https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854/5 "2024-02-11T09:18:47Z")

</div>

Thanks for that!

Weird it didn’t work for me the first time. I had to delete the expression and refresh the editor for the syntax error to go away.

---

<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:** [April 20, 2024, 11:57am UTC](https://forum.bubble.io/t/filter-or-search-constraint-by-a-list/306854/6 "2024-04-20T11:57:05Z")

</div>

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