Referencing fields from two data types to get a value

Hello, I have one data type labelled “menu” with dozens of fields. One of these fields is “kitchen name.” I have this field linked to another field in the user data type (also named “kitchen name”) via the field type where both are set to “user”.

In my repeating group I would like to be able to show menu items of my menu data type by referencing the kitchen name and matching it with the current users kitchen name. Thank you very much in advance.

Here’s the link: Wowcater | Bubble Editor

What page is it on your editor?

Also instead of a text field “Kitchen” it’s even better if you make a data type called Kitchen and assign a user the Kitchen and the menu a Kitchen.

Hey Tyler, thanks I’ll get on that. The page is vendor_online_store

I reason I like the Kitchen data type is you can make a page for the kitchen, show it’s current Chefs, etc. Change the name without breaking the link between the menus, etc.

I can take a look at the editor in a little bit and once you add the kitchen data type and replace the fields.

I have the editor open but I won’t touch anything yet cause looks like you’re making changes still

Hi Tyler, ok everything should be lined up now. I’m still not getting the “menu” filtered by kitchen. I like this lay out better with having Kitchens as a data type. It makes more sense to me. I’m thinking of deleting many user fields until I’m left with email, user type, password.

Okay now add Kitchen as a field under the user with the type Kitchen. Then create a new kitchen (either manually through the data tab for now, or make a whole screen to add kitchen) and make the User’s kitchen and the Boxed meal’s kitchen the same.

Then for your repeating group make the data source:

Do a search for “Boxed Meals” with the constraint “Kitchen = Current user’s Kitchen”

Then inside the cell of the repeating group make your text “Current cell’s items description” and all the other fields so the user reads them inside the cell

It doesn’t seem to like the logic in the constraint. Maybe I’m missing something

Yea the red error text you are trying to reference the User’s “Kitchen Name” with the type text. Add a new field to the user and make the type Kitchen just like you did with the Boxed Meal. So you would be storing a specific “Kitchen” under the user, not just a string of text like it is currently

Awesome! Thank you so much, it works perfect!

1 Like