# How do I handle complex calculations?

I’m working on building a meal planning app. I have a working prototype built in Airtable, which relies heavily on formulas. However, it’s not user friendly enough for my clients, so I’m trying Adalo.

The problem is, I have no idea how to handle these complex formulas in Adalo in a user friendly way.

Example:
In Airtable, I have a Targets table. This is basically a list of weeks. Fill in the “Current Weight” field, the “Goal” field, and the “# of meals per day” field, and airtable uses the formulas I’ve set up to determine the goal daily calories, proteins, carbs, and fats (Each in their own field, each field using a formula).

Then I have a Meal Plan table. All I do here is select a “Protein Source”, a “Carb Source”, and “Fat Source”. Each of these is linked to the Ingredients table.

When I fill these in, Airtable uses the formulas and shows the exact quantities of each needed to hit the goals set for calories and other nutrients.

The only real manual work is creating the appropriate number of records for each day. (If # of meals per day is 3, I need to manually create 3 records per day in Airtable)

In Adalo, I can get the meal created, but I can’t figure out how to get the quantities for each ingredient to scale to the correct amount to hit the targets set for each week.

I hope this isn’t too complicated, but even if it is, what are the best practices for doing complex calculations with an app like Adalo?

1 Like

You can try if using Adalo on top of Airtable and with this, the existing Formula may work for you.
Note that there are certain restrictions with the Airtable API such as Maximum Number of records you can read from the database: 100.

You can try to create the formulas in Adalo using Custom Formula.

What I learned today working on this

is that there are some restrictions in combining functions. E.g. a Round(Round(##)) did not work for me.

1 Like

So I think I’ve figured it out. I’m basically using a series of forms and/or a form with multiple actions that contain parts of the formulas. Basically, I added an action for each step of the formula to reach the end result. I would then record the end result in the database.

I was tripped up because in Airtable the formulas were real time, but with Adalo once I realized i’m saving a snapshot of the formula results it made more sense.

hey Jason would you mind sharing a video or something so I can see your app?

Reason is I’m building a meal planning app but using bubble. I’d LOVE to use Adalo because its so much faster & looks amazing but I didn’t think it would have the capability to do the calculations but seems like you may have found a way around it?

How are you finding the airtable integration? I’ve heard thats limited to 100 api calls? we have thousands of users already so that could be problematic possibly so might need to stick with bubble for that reason but would still be interesting to see what you’ve managed to do

@MikeS Hi Mike, regarding the API limits, I checked the Airtable documentation:

The other limitation I mentioned in one of my post in this threads is about the number of records you receive within a Page for one API call:

For more details you may want to search for API limits in https://community.airtable.com/

For a meal planning app you probably need filtering on weekdays, week, which is currently not available in Adalo out of the box. The combination with airtable formulas can help a lot.