Making complex calculations in the background


I did a manual MVP of an algorithm in Google Forms & Google Sheets that’s sort of like this:

Get a survey, and question 1 asks you: A or B? (weights 30%)
If you choose A, you get +1 point.
If you choose B, you get +3 points.

Then question 2 asks: C or D? (weights 70%)
If you choose C, you get +1 point.
If you choose D, you get +3 points.

Then you sum up a weighted average of your points. Let’s say you chose A and D. That’s 1 point * 30% + 3 points * 70%

And then in another tab of this google sheet I’ve got a table that’s something like:

Respondant | Company | Result
Person A | XYZ | 2,4
Person B | ABC | 1

And I need users to see a list of every person who replied the survey ordered by result from biggest to lowest, and be able to filter these results by company.

This is a simplification, but the real MVP has many questions, many answers, many points being given, and in the final table, many columns and rows.

There are many topics mixed in this question. I know I can have people answering a survey in my no-code app. I know I can display information filtered by what the user chooses. But my question right now is, how do I run these calculations in the background? Should I have an external database and connect with it through APIs? In an Adalo database, can you make it so if there’s a new reply, the calculations are done automatically and this information is added to the final table?

I’m lost on this last part. Any help would be appreciated.

Thanks a ton!

Hi @Sacchi ,

Even though Adalo does not have backend workflow which does batch processing, but we have an equivalent of that process, but it will take some time to finish.

  1. Design database that include result of calculation and breakpoint of each process, because Adalo only has single expression of conditional, so we must break down to the most detailed factors
  2. Use custom list to loop through that have sequence master collection, which is basically records of 1 to any number in sequence
  3. Use nested list with countdown to update the scoring collection based on sort, either descending or ascending with the property that is pre-calculated.

If you want to have chained actions, put additional property in the scoring collection to mark for completion, so countdown can determine when to stop the process.

1 Like

The way I see it you can do it in one of 3 ways,

  1. Do the calculations on your on hosted web server running php,node, or java etc and consume the adalo data via the adalo api
  2. Use cloud functions like Amazon lambda or Firebase functions to do the same as above, if you wish to do it serverlessly
  3. Use online automation tools like integromat to perform the math functions for you, while consuming the data in your database via the adalo api. A tutorial link on how to do math functions on integromat: Math Functions Help Docs | Integromat Help Center. But it takes a bit of time to get the hang of it, but less hassle than managing code server/serverlessly.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.