Handling calculated fields in Microsoft Flow

Have you noticed that when you have calculated fields that for example displays the difference between two date fields in SharePoint and Microsoft Flow you will get a number like 13.00000000000 returned:

Handling calculated fields in Microsoft Flow 1

 

This is not always what you want, is it?

Handling calculated fields in Microsoft Flow 2

There is an easy way to clean this up:
 

 

Below you can see Compose 2 simply displaying the Difference field and the result will include all the 0s.

Handling calculated fields in Microsoft Flow 3
 
The second Compose action uses the following expression.
 
first(split(triggerBody()?['Difference'],'.'))
 
 

References

Split function

first function

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: