Show Me a Real Recipe App - With Quantities

I have a solution to my problem, but it’s cumbersome and ultimately static. Am I missing something?

There are many “recipe” example apps I found, which associate a number of foods to a dish. This is an easy thing to do in the relational database.
Food:[name,nutrient1,nutrient2,…] → Dish:[name,(Food,Food,Food…),nutrient1 sum, nutrient2 sum,…]

But a real recipe has a quantity of each item. I don’t see any way to set this up in Adalo except to add an intermediary database with a line for every entry in every dish, with a quantity, subtotaling the nutrients, then doing a total of all nutrients when the dish is built.

Food:[name,nutrient,nutrient,…] → Dish Item:[quantity, Dish, Food, qty.nutrient1, qty.nutrient2,…] → Dish:[name, Dish Item, Dish Item, Dish Item,… , nutrient1 total, nutrient2 total,…]

So the user picks a list of foods for the dish, and they are added to the “Dish Item” collection each with quantity 1. Then the user sets the real quantity for each Dish Item and as each is saved I have the nutrient subtotals for the Dish Item computed and saved. Then the user clicks “Update Dish and Save” and only then are all the sums totaled for each nutrient.

I’m doing a pretty serious diet tracking app. Over 40 nutrients are being tracked. Writing update lines for each nutrient in three different databases has been cumbersome, and debugging is going to be a pain. The “Dish Item” database will get large with data not needed later. And I’m left with static data - if the food database is updated none of the old meals update.

Did I miss some way to have different quantities for items in a many-to-one relationship, and to use that to drive calculations on related sub-data?

Hello,
Your current Adalo approach, while functional, is indeed cumbersome and static due to Adalo’s limitations in complex, dynamic calculations across deeply nested relationships, especially for many nutrients. The “Dish Item” collection is a necessary workaround for quantities, but the nutrient sums being static in the “Dish” record means old meals won’t update if food data changes. For a serious diet tracking app requiring real-time, accurate totals, you’re missing a dynamic calculation method, ideally by leveraging Adalo’s Custom Actions to integrate with an external backend service (like Xano or a custom API). This offloads the heavy computation and ensures data consistency, making your app more scalable and maintainable.

Hi Shawn @sdmahaneysc,

Welcome to the forum!

You will need 3 collections to make this work properly. You’ve already asked a correct question - where the quantity should be stored. There is no way to store it, if you have only Food → Dish collections & relationship. You will need to have something like:
Food (where you store general info about ingredient)
Dish (where you store exact recipe)
Ingredients: a Dish can have multiple Ingredients but Ingredient belong to 1 dish, and Ingredient belong to 1 Food only. Here you store the quantity and possibly other required details.
Also in terms of tracking you’ll be working with Dish and Ingredients collections most of the time. The Food collection is kind of “data dictionary”'; you’re going to fill it in once but you’ll rarely update it.

Best,
Victor.