I have a "Get a Row" action in my Flow. Within the Excel file, there is a calculated column that is set to 'Number' format. However when using this in the Flow, it adds on 13 decimal places to values in this column whereas in the Excel file, it is only set to 2 decimal places. The Flow looks like it is returning the value as a string rather than an integer.
In the Flow, I have tried adding a Compose action with both formatNumber() and also Int() using the output from the Compose action in the screenshot above, but I am getting the below error messages:
Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'Int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'formatNumber' expects its first parameter to be an integer or a decimal number. The provided value is of type 'String'. Please see https://aka.ms/logicexpressions#FormatNumber for usage details.'.
Does anyone have any ideas? Thanks!
Hey, ok cool. As @Matthy79 suggests, try using the float to convert the number
formatnumber(float(triggerBody()['number']),'0.00')
Hi @Jondoesflow
I think the issue is that the Flow is not returning the Excel column value as a number, as I have just tried your suggestion and am getting the below error message:
Just for reference, this is what the action looks like (I have blocked out the column name):
It looks like the value you provide is a decimal that comes as a string. FormatNumber needs a Number and int needs a string that can be converted to integer. Have you tried to convert the string to a decimal/float?
Hi,
Yes, you need to write the expression as:
stampcoin
51
Michael E. Gernaey
39
Super User 2025 Season 1
CU30040420-0
23