Simple sum of two calculated values

Hello, I have a form with some user inputs and I managed to get some calculation done. E.g. Item, price as inputs and I derived the total. I also calculated taxes in a separate field. Now I just need to do the final sum of the products and taxes. I can’t achieve this on the same form - may be something very simply but I have spent considerable amount of time trying different things but no success.

In other words I am trying to do a sum of two derived values on the same form. I am trying to accomplish this thing in elements. Alternatively, paranthesis if supported will make my life easy.

Can someone help?

Can you not sum up the original amounts to get a total? Where the others are sub totals?

You could set a group add type number and let it take the number of the calculation you make them reference the group’s number in another input?

The problem is sum and multiplication all in one line that’s not allowed due (as per my read parentheses are not supported).

Secondly for some good reason I need to show both pretax amount and tax amount separately. And then sum of both those.

I prefer to do extra steps if it’s not easy but I am a newbie and appreciate if you can share some details on the remedy you suggest. May be screen shots can help.

2 Likes

Vincent, I tried moving that grand total field to a different group but still no fix. It shows 0 total - which tells me that the iterative calculation that needs to happen is not happening. Bubble is so popular and I am sure there is some fix. Some ideas would help here how to deal with this very very basic issue.

Would be easier if you could share your edito or the problem

Here is a simplified version.

See the Qty. * price - gives the sub-total. There are two items fields for now. the pre-tax sub-total doesn’t get populated, so as tax and grand total. tax I just hard-coded 10% but still no luck.

It looks like these computations need to happen in an iterative manner in order for it work, just not sure how to accomplish this.

I dont think it is open for editing. Or you have the wrong link

I just tried clicking that heading and it works. In case, here is the URL:

" https://bubble.io/page?name=index&id=shop123&tab=tabs-1 "

Remove the quotes and spaces

Make sure the app is ‘everyone can edit’

Have you tried using the math.js plugin. You can install it to you app and then set dynamic data within the desired field through ‘get data from an external API’ and choose Math.js. Afterwards you can include any equation you like. Let me know if it works or not, cause I’ve had similar issues with Bubble recently.

Cheers

It tells me collaborators can only be added in a professional plan which I don’t want to sign up until this platform gives me some comfort feeling that it will work for me. If you somehow send me your email address, I think I can invite you.

Settings > General > Application rights

You can tell my knowledge on this platform too new…

try now.

yes, in your case you could make use of math.js. I have a lot of ‘complex’ calculations in my app, but they all happen from values that are actually stored in the database.

If you store those values, you can use them in additional calculations/formulas.

Also, it helps to not put the values in the placeholder :stuck_out_tongue:

You can do it if you want to store values in the database, there might be other solutions but then I would look at math.js.

However, since it it is a shop I guess it would make sense to create a button to ‘add to cart’, where it calculates a (sub)total. It doesnt even have to store in the database, you could also use a custom state that is a list that you add all the subtotals to.

I may be misunderstanding … but you can do the maths in “initial value”.

image

image

3 Likes

Nigel, yep. That fixed the problem. I was not placing this calculation in the initial content - I was just doing it in the placeholder section. But as soon as I modified in my App - I see proper calculation shows up.

Awesome thing. Now I can focus on moving forward :smiley:

Thanks to you and All other members for your support.

This topic was automatically closed after 70 days. New replies are no longer allowed.