Forum Documentation Showcase Pricing Learn more

How can we run complex calculations in bubble.is (with our without blockspring)?

Hi all,

My app needs to take a set of numerical inputs from users, then run a set of complex calculations that will differ in nature depending on the inputs (for example, the output could have 10 or 20 outputs depending on a user’s input)

I suspect it will not be possible to do this in Bubble.is in a scalable way. Not only outputs will vary but there will be a need for complex mathematical functions (like logarithms etc.).

So I suspect the best way to achieve this is by using blockspring’s Google Sheets blocks, where I export stuff into a google spreadsheet, run calculations there, and the read the data from the spreadsheet.

I unfortunately am having issues with “Append values to existing Google Spreadsheet” which is what I had intended to use for supplying user’s input numbers to the spreadsheet. (The block doesnt seem to like when you enter as values a comma seperated string like “Alpha, 5, Beta, 10” etc. It expects a “range” input, but not clear how to supply a “range” in the “value” field) I reached out to Blocksrping support as well but no luck so far.

Anyways, long story short:
A - Has anyone had the same problem and tackled it via Blockspring? If so, how? (Python coding would be another way but custom functions are not yet supported in bubble integration apparently)
B - Is there a way of implementing complex/variable calculation logic in Bubble.is without using Blockspring?

Thanks!

I’d need to know a little more about what you are trying to execute. Is it purely input based? Any formulas on your end? Variables?

However, a few ideas of what Id do:

1- Id be shocked if you cant as long as we are talking about straightforward input based computation.

2- Wokfram Alpha does connect via API. I absolutely guarantee that can handle amything mathematical you could ever conceive of.

3- you can do logs in HTML via JavaScript extensions and you can work with HTML in Bubble.

It is actually a straightforward calculation: It is a home investment return calculator that will take as input the house price, investment horizon (120 months? 240?) how much mortgage will be used (it will be a fixed rate mortgage), assumptions about monthly rent, interest rate, inflation, and it then needs to create a monthly output showing how much asset, liability and equity exist for each month (as well as profit)

Anyways, so calculation is stratighforward but it appeared complex to execute in bubble.is. The point is that the output needs to be written back to the app database, which I couldnt quite figure out how to do in a flexible way (what if user wants to run the scenario for 240 months rather than 120?)

Would Wokfram Alpha or HTML do the job?