Hello,
I am trying to convert a decimal number (Ex: 1234.1) that is stored as a string in a CDS field to an integer or currency value to store in a currency field.
I used the int() to convert and i had no issue if the value is without a decimal like 1234 however the int() fails when it has decimal value like 1234.1 . The error message i get is :
Unable to process template language expressions in action 'Create_New_WBC' inputs at line '1' and column '44099': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
My flow action where i am using the int()
Any suggestions on how i can convert this string to an integer or a currency? Thanks in advance.
Solved! Go to Solution.
Try following expression :
Try following expression :
Hi @Nithin_Vanam ,
Do you want to keep the integer part of the string and discard the fractional part of this value? Such as format the string 1234.1 to 1234 and then save the 1234 to the int or currency field, if yes, @DeepakS 's solution should work for you.
Best Regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@DeepakS , that worked like a charm. Thank you for that.
@v-alzhan-msft : Is there any way i could retain the value after the decimal? For ex convert a string of "1234.5" to a numeric value of 1234.5 ?
Thanks for all the help.
Hi @Nithin_Vanam ,
I kwon we could add the Number of decimal places for a Number/Currency type column in sharepoint, and then we could add the value with decimal in the column.
Maybe you could take a try.
Best Regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the suggestion. Will give it a go later.
User | Count |
---|---|
78 | |
56 | |
53 | |
43 | |
39 |
User | Count |
---|---|
80 | |
80 | |
75 | |
67 | |
43 |