Filter list by embedded fields

I have just rebuilt our entire database (previously external) in bubble and have hit a huge roadblock that I’m hoping someone can help me navigate.

I have a list of recipes which have fields that are embedded with other ‘things’. This is their structure:
Recipe’ has a list of ‘Ingredients’ within it,
Each of the ‘Ingredients’ have a ‘Portion’ within it,
Each of the ‘Portions’ have a ‘Food’ within it,
Each of the ‘Foods’ have a list of ‘Tags’ (e.g. vegan friendly or contains nuts) within it.

Also, the ‘User’ has a list of ‘Tags’.

Now the issue I’ve hit is that I need to present the user with a list of Recipes which do not contain ingredients whose portion’s food does have a tag which exists in the User’s tag list.
I can’t get the past the fact that I can only use :first item to get a result on the lists.

I’m really hoping there’s a simple method which I’m missing here.

Thanks in advance

Are you showing the recipes in a RG? I’m not completely sure but if you are, I think you should be able to have the constraint on the Do search for and have it “tags= current user tags”.

Without seeing your app structure im not totally sure. If you could post some screen shots that would help us out.

Thanks @twilson9034

I don’t really know how to explain the structure better than my initial post.
Or what screenshots would help you.

Yes I’m trying to display in a repeat group.
Your example of the constraint above is what I tried, however, the “tags” in that example is embedded under other fields within each recipe.

So I think the main issue is that I know how to search for a single item in a list or I can search for if a list contains a single item - by using ‘:item#’ or ‘:first item’ etc…
But I actually need to filter more like this: ‘If any of the items in this list are present in this other list’.

Hope that makes sense

I have tried and failed to do similar, where I created a Task management app, where I wanted to eb able to filter& sort by a list of “priorities”, which was a separate data type.
I wasn’t able to get this to work, so I’ll be interested if anyone has a solution for this.

@jim3 if you are not on a hobby plan you can add collaborators and id be more than happy to help you out. same for you @alan.mackintosh1, or at least make the app so anyone can view and send the link via message. That way i can see how it looks and what your limitations are.

I think this is a tough one. What you’re looking at is embedded search multiple levels down.

For an embedded search, in your “Search for Recipes” searchbox in the RG, for the Ingredients constraint you would put in “Ingredients is in Search for Ingredients” which opens up its own searchbox for ingredients, and in that searchbox you’d put a Portions constraint which is “Portions is in Search for Portions”… and so on and so on.

Embedded searches can be slow and I’ve never done one more than one level down, so I have no idea whether it would work with your dataset.

Then if you are searching a list based on a list, you are looking at an advanced filter using the intersect with function (search the forum and you’ll see a bunch of posts).

Good luck and experiment with it a bit more. You may want to book an hour with one of the bubble freelancers to see if they have a better approach. Also check out some of @keith posts – he does the list shifter plugin and he knows a lot about more complex searching.

PS: a workaround would be to somehow replicate all the bottom level tags as a list within Recipes, and that would vastly simplify the search of course.

why you can’t use a multiple filtred?