Hi all,
In Sharepoint I have a calculated column for number of days left to do an operation. Flow sees it as a string. How do I round that number to integer with a 'select' action?
Thanks for assisting.
Hi @Anonymous,
You could try to convert it by using the int() function.
Like:int(Dynamic content)
Please take a try.
Best Regards,
Barry
Hi @v-bacao-msft,
thanks for the suggestion. Here is the error I get:
InvalidTemplate. The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{ "DaysLeft": "@item()['DaysLeft']", "DaysLeftRounded": "@int(item()['DaysLeft'])" }' failed: 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
There is this thread with more details, I inadvertently created another request.
I'd select it as is, and then compose it into an integer.
Here's a recipe I use to round numbers - you'll notice I change the number to a string, then split on the decimal point, and then turn it back into an integer. (You won't need the multiply and divide by 100.)
The value I'm rounding is varMonthlyAmount.
I'm rounding to two decimal places, hence multiply and divide by 100.
div(int(first(split(string(add(mul(variables('varMonthlyAmount'),float(100)),0.5)),'.'))),float(100))
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
48 | |
17 | |
15 | |
12 | |
12 |
User | Count |
---|---|
58 | |
40 | |
24 | |
20 | |
19 |