Forum Academy Marketplace Showcase Pricing Features

Show if list A contains any item in list B

Hi everyone,

I have looked through the forum to no avail. I’m basically trying to recreate a tinder pile because of a bug that has caused it to completely defeat its purpose.

I need to show the profile of user B only if their criteria matches user A. The page shows 1 user per refresh only.

I’ve got all but 2 of the filters sorted. Area and zones.

Basically I want user B to show up as a profile if their area preference is ANY of user A’s.

This seems like such an easy thing in a data perspective but somehow bubble can’t do it.

All the solutions I saw on the forum didn’t work (i.e. advanced filter, list A intersect with list B etc). The best it did was load up the match buttons but none of the profile of user B showed up…

This is a make or break for my product. I can’t change the service design flow.

Thanks!

Hi @carmen1

If I understand correctly a user thing has a list field of areas and a list field of zones.

If so, the you can place a conditional in the group element that displays the profile that reads “group user list of areas CONTAINS page user area”. The same for zones … “group user list of zones CONTAINS page user zone”.

Hope the above helps :slight_smile:

Not sure if I can do that in the ‘search for users’ function?

When I try area CONTAINS current user’s area, user won’t show up if list contains ABC while the other contains BCD, for example.

And the intersect statement also didn’t work ( I set a custom state to show the current users’ area list, group user desc is where user B’s info would be displayed).

@carmen1

It seems that you would need to follow a possibly less performant way to do this.

This involves using “search:filtering” and advanced searching > https://bubble.io/reference#Data.SearchOperator.AdvancedFilter
https://bubble.io/reference#Data.Messages.list.contains_list

Usually, I try to avoid going this route because things can take longer than desired to process. To avoid having to go this route depends usually on the overall arquitecture of the functionality that has been built (dB structure, UI, etc etc).

But do not necessarily pay attention to others experiences, as it could work for your app.

If it makes sense for you, give a try nonetheless! :+1:

Thanks. I will give it a go. If it doesn’t work I might have to do a workaround and ask for the customer’s first choice area, and show anyone who has that area selected as a preference.

1 Like

have you found a solution to this? I’m trying basically the same thing :slight_smile:

Please describe your problem.

As in checking if User A’s preferences matches any of User B’s preferences?

Then you need to do a search for Users: filtered > Advanced: This User’s Preferences intersect with User B’s Preferences:count > 0

That will return a match if any of User A’s preferences (a list of preferences) contains any of User B’s preferences.

1 Like

Or you can state > user’s A list contains list in user’s B list. The “contains list” operator is the key to this expression.

I believe “Contains list” only returns yes if the first list contains all the entries from the second list?

I.e. this would not work for matching User A to User B if any, but not all, of the preferences match. If you are looking to match two users with 100% identical preferences Contains list would work.

Yeap :+1:t2:

Sorry I’m a bit late, I hope what I did would help you too.

The solution didn’t work for me. I had to incorporate a ‘first choice’ question into my service flow to work around this. So it became list contains value of ’ first choice’ rather than list A containing any value from list B.

To be honest it isn’t the best but I just couldn’t dwell on it any longer.

Have you found a solution yet? Need this

I am trying to do the same thing.

I want to compare a bunch of orders and intersect their dates to pull a list of orders with conflicting dates. Advanced Filtering is not working for me.

Anyone have a solution yet?

Same problem here.
Why we don’t have a “contain any of a list”?

@hkhalil1803 @hetnon.freitas

This guide by @NigelG may be helpful

1 Like

Try the advanced filter “:intersect with” and you can use “:count>X” at the end to control the number of common items in each list.

If you search the forum for intersect with you’ll see some examples of this method.

1 Like

Ed727, it doesn’t have this option inside the Search. What I’m trying is to do a search for the things (Item) which have a list of things (Containers). For a given specific Item (Item A, let’s call), which has a number of speficific containers (C1, C2, C3, for example) I need to find all the other Items that have at least one of these in their Container list.

Intersect doesn’t work.

I will have a look in the guide from @NigelG

@hetnon.freitas

When filtering you can always do nested searches…

In essence, search for, advance filter, search for again…

Very non-performant though … but it all depends on circumstances

Thanks. I will give it a go and post here later.

1 Like