# Rollup of secondary items in recipe calculator

**URL:** <https://community.glideapps.com/t/rollup-of-secondary-items-in-recipe-calculator/77020>\
**Category:** Ask for Help\
**Created:** [October 13, 2024, 5:00am UTC](https://community.glideapps.com/t/rollup-of-secondary-items-in-recipe-calculator/77020 "2024-10-13T05:00:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lof](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_lof/32/48029_2.png) [@Daniel\_Lof](https://community.glideapps.com/u/Daniel_Lof)\
**Post date:** [October 13, 2024, 5:00am UTC](https://community.glideapps.com/t/rollup-of-secondary-items-in-recipe-calculator/77020/1 "2024-10-13T05:00:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [October 17, 2024, 12:20am UTC](https://community.glideapps.com/t/rollup-of-secondary-items-in-recipe-calculator/77020/2 "2024-10-17T00:20:26Z")

</div>

I understand the issue. Two possible ways to solve.

1. Interactive: Use a custom collection for the meals and then a collection within the custom collection for ingredients
2. Not as interactive: Create an HTML table. Use template columns to generate HTML structure at the ingredient level. Join these at the Recipe level and view then as Rich text within a custom component at the meal level

---

<div class="post-metadata">

**Author:** ![Daniel\_Lof](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_lof/32/48029_2.png) [@Daniel\_Lof](https://community.glideapps.com/u/Daniel_Lof)\
**Post date:** [October 18, 2024, 11:30am UTC](https://community.glideapps.com/t/rollup-of-secondary-items-in-recipe-calculator/77020/3 "2024-10-18T11:30:26Z")

</div>

Thank you Robert. I went with option nr 1. Worked perfectly!
