Math formula doesn't want to give the correct output

Hi,

I have the following formula but it keeps returning 0 in the preview app.

Please can you assist?

(SUM([pageVars.income1,pageVars.income2 ])-SUM([pageVars.expense1,pageVars.expense2,pageVars.expense3,pageVars.expense4,pageVars.expense5,pageVars.expense6,pageVars.expense7,pageVars.expense8,pageVars.expense9,pageVars.expense10]))

Hi there!

It sounds like one or more of the variables might have an incorrect value or type. I suggest you try debugging this by printing all the variables out with a simple joining formula like: JOIN([ pageVars.expense1, pageVars.expense2, ...]) to see what the individual values are when you’re trying to sum them. Perhaps that way you can figure out which is the problematic value.

Thank you Akseli,

I tried this but it gives me all numeric values.

I tried this, but wasn’t able to repro the issue. If you’re sure that all values arrive as numbers here, could you share me your app ID so I could take a look at the problem and see if I could find the root issue (or a bug)?

Hi,

The build is 105930

Thank you

Could you tell me where to find the Formula? And how to test it on the app?

Hey

It’s on the budget page on the button at the bottom. It’s an alert I added to the button.

You can just preview the app and on the budget page you can enter all the amounts in there.

This is due to numbers actually becoming text type after user input. If you add NUMBER() around each value this should work correctly.