Here’s a thing that has been a head scratcher for some reason during the weekend. I’m building a everyday management app for a small restaurant. In this there is a recipe calculator. It calculates production need based on input number.
The calculator page consist of a choice component and a number input, these values are connected to user table.
The structure of tables are pretty simple:
Meals | Recipies
Recipies | Ingredients
Ingredients
Recipies consist of ingredients. Meal consist of one or more recipies. The results are displayed in a table on the recipe calc page based on selection. Getting it to show summary of recipies + qty needed is not a problem. But on same page I’d also like to show a breakdown of ingredients + qty needed, and for the life of me, I can’t get this to work properly. As one ingredient can be included in several recipies I will also set it up to roll up the total and display only one row per ingredient.
I’m scratching my head thinking I might need to re-do the flow and include a helper table to which an action writes ingredient Id:s and meal id:s and use this as source for the ingredient summary table but not quite sure this is the right way.
Solution might be easier than I think I suspect. I kinda got stuck in this one.
Any advice would be much appreciated.
![]()
A. Things that has B. Things that has C. Things. Display rollup need of qty of C. Things based on number input of qty of A. Things needed to be produced.