How to do calculations?

Hello, Bubble newb here. I’m trying to do a simple budget app and can’t figure out how to do a calculation on fields that are the result of a separate calculation. Here’s the example:

Rate = $100
Task 1 People = 2
Task 1 Hours = 3
Task 1 Budget = $600 <- this was calculated

I have the app doing that just fine. Now I need to add multiple Budgets together to get the Project Budget.

Rate = $100
Task 1 People = 2
Task 1 Hours = 3
Task 1 Budget = $600 <- this was calculated

Task 2 People = 3
Task 2 Hours = 10
Task 2 Budget = $3000 <- this was calculated

I can’t seem to find a way to just add the values of Task 1 Budget and Task 2 Budget since they are the result of a previous calculation.

What am I missing?

1 Like

Expressions like this are not very well handled in Bubble yet (it’s on their roadmap), so this is one of those things that are a bit confusing for new Bubblers.

I recommend the plugin Toolbox by @mishav. It contains an element called Expressions that allows you to set up traditional calculations with parentheses.

3 Likes

I do a lot of work on calculations, so I know a thing or two about them. Perhaps I am not understanding the question. Why cant you have an element that adds budget 1 element’s value + budget 2 element’s value.

Note: they must be input elements, not text elements.

3 Likes

Using Input elements instead of Text elements was the key. Thanks.

4 Likes