Issue with contains / intersect with list

Hi there guys, hope you can help me to solve because I spent the whole night on that without experiencing any success

I have a list of product requested which is (for exemple) : A,B,C,D

I need now to display the users that can provide this items . Using the function :contains list i will see only the user(s) which own all products requested. If there is no user which owns all the items the RG will be empty.
I want to avoid that because sometimes needs of customer can be satisfied by multiple users.

so let’s say that in my db there are the following users

User 1 owns " A,F,Z"
User 2 owns “G,H,I”
User 3 owns “B,C,E”
User 4 owns “D,H,I”

Okay so my RG should display User 1, user 3 and user 4

I tried all functions but with no success
I’m sure that I was so close

A great thank you to the hero of the day :rofl:

Additional informations:

In the first case ( one user own all the products i used this formula on the RG : “Search for users:filtered” and in the filtered section this: " Advanced : Search for order’s requested products contains list This user’s ownings"

The db is structured as follows:

User : “ownings” is a list of products
Products : products from catalogue
Order: "requested products " is a list of products

Here you have the app in editor : https://bubble.io/page?id=testforsellerbuyer

The application offers the right to edit , so if you made some mistakes use the page backup to restore the previous situation

the user "user@test.com" owns all the product

use this link to test changes : https://testforsellerbuyer.bubbleapps.io/version-test?id=1518220148672x323478448204696200

Hi @lam,

I updated your filter to do what you need. Check it out and let me know if you have any questions. If you use “intersect” it’ll look for any items that are in both lists of orders. You’ll see that I used an advanced filter to do this. The intersect operation returns the list of results, so as long as there is > 0 intersected orders, the user should show.


Gaby | Coaching Bubble
Private coaching, courses, and tons of free resources

8 Likes

Hey @romanmg , Thank you ! you made my day :slight_smile:

I didn’t understand the function of :count>0 but happy to hear that this do the work

I had another issue right now … On the same project I want now to choose the sellers by product in order to know who has selled what. I created so a product’s RG which contains in each cell a RG for users. My main issue happens in workflow … when I click the button “test” I should add in “appartenance order” db a row with the item (which should be current cell product but any choice is offered for that function) , the seller and the order linked

How can I solve?

Thank you for your help :blush:

Please guys , help. Hard trying but hard failures :confused: