'Filtering' a Repeating Group across Data Types

Can someone help me achieve the following which is driving me bonkers?
I want to click an icon on a record in a Repeating Group that will display a PopUp that contains records from a different data type but that relate to the row in the pop up.

In a nutshell I’ve got some students who are selling products from various stands/stalls referred to as “Outlets” to raise money. A Student can have as many Outlets as they like. Outlets are stored in a Data Type called Outlets. Students are stored as Users. I have created a Page where each student who’s logged in will see only their own Outlets in a Repeating Group and that works well. I now want them to be able to click an icon next to each of their Outlets in the RG that will enable them to add, view or delete Products from that Outlet.
I have a Products data type that stores the Products they sell and a DataType Called ProductOutlet that stores what Products are available at what Outlet as well as how much that product costs at that outlet and which Student/User “owns” that outlet.
Currently I can only get the icon to display a PopUp that shows ALL products at ALL outlets when I want to display only Products available at the selected Outlet (ie, the one on the current row of the RG)
If anyone can help I’d be so grateful because this is driving me mad and I’m guessing it’s quite simple.

Set the content type of the popup to be ‘outlet’. When you open the popup from the RG, display the current cell’s ‘outlet’ in the popup.

The RG in the popup should have a data type of ‘products’ and the datasource should the be the popup’s outlet’s products.

Make your popup type “Outlet”.

Screen Shot 2021-03-15 at 8.34.42 AM

Then when you show the popup, immediately after that step in your workflow, add a workflow step to assign your outlet to the popup (Bubble misnames that steps “Display data”).

Screen Shot 2021-03-15 at 8.37.01 AM

Then your Product data source for the RG can be constrained by this Popup’s Outlet and current user.

Thank you! Thank you! Thank you!
Contraining the RG by Outlet AND Current User was the key. I was only using one constraint - it seems so obvious now. Thank you.
Did I say thank you?!

1 Like