App Formula miscalculated when updated by API Calls

Hi,
I use an expression to set the value of a column using the values of other cells in the same row.

It works fine when I use Appsheet UI. But when I update using an API call, the value is miscalculated. It is not blank but, a wrong value is set. (To be more precise, in my opinion, the “if” statement’s result is wrong )

I use the Appsheet app to check the new row added by the API call, the wrong value is seen. Then I open to edit the row without ever changing anything, the value is recalculated but this time value changes, and the right value is set.

The problem is that the expression’s result differs when an entry is created by an API call or an Appsheet form.

Can anyone help with this problem?

What is the expression?

1 Like

Hi, Original expression was this

I simplified it to

[User Input Price]/((100+[VAT Rate])/100)

it did not work either…

I forgot to say that, I use Google Sheets as database…

Maybe this?

[Fix for expression giving 0% or missing decimal part](https://community.appsheet.com/t/fix-for-expression-giving-0-or-missing-decimal-part/15061) Tips & Tricks ?

Trying to divide two numbers to get a percentage but always getting 0? Trying to divide two numbers but losing the numbers after the decimal point? TRY THIS Convert one or both of the values in your division expression to a Decimal value, either by: (1) wrapping the value in the expression with the DECIMAL() function; (2) multiplying the value in the expression by 1.0; or (3) changing the column’s type to Decimal if suitable to the app. FOR EXAMPLE If computing a percentage from two Number co…

1 Like

Great !!
Thank you… It worked

1 Like