HI All,
I'm using Appian Integrations to call one of the API's. I have set the response Body parsing to "Convert JSON To Appian Value" instead of the default "Return raw response body".
So when I tried to call an API with the above set configuration,
The result returned by the API call is being converted to an integer number.
Example : If i set my response body to "Convert JSON to Appian Value",
the expected result should be totalAmount: 42103.95 but it is displayed as 42104.
Is this how it works? Does configuring response body parsing to "Convert JSON to Appian Value" rounds the decimal value to nearest integer?
Discussion posts and replies are publicly visible
That's odd. Normally the decimal value should stay the same. I have just run a test by using a!fromJson(a!toJson({number:42103.95})) and it worked fine.
Are you casting it to a CDT using cast()? If so, if an integer data type has the corresponding keyword it will remove the decimal value to convert it into an integer - for example tointeger(42103.95) returns 42103.95
If not, could you either copy and paste your SAIL or upload a screenshot?
Hi, I have the same problem.
The integration with the api don't return the right value with "convert json to appian value" ( 162132.8 instead of 162132.79 ).
I put the image with "converting json to appian value" (162132.8) : and the image with raw text (162132.79 ):
The api returns a number (double) - test with postman :
This is just a display "issue". When turning a number into string for display purposes, Appian rounds aggressively. You can find a gazillion of discussions on that topic here.
Nothing wrong! Just go on.
Faced the same issue today, used the test function to resolve it .
-> use convert json to appian value in integration.
->go to the node and then format it with the pattern you want like below.
->Use the Text (index(local!body,"node","node",{}),"######.##")
this will give you the data which comes in raw