cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
derk Helper I
Helper I

Calculated SharePoint field in Flow email showing extra 0's

Hello,

 

 I have a calculated field in a SharePoint list that calculates the days between two dates. I added this field into a flow email, but it adds 0's to the number like this. How would I go about removing the decimal place and the 0's? I changed it to a number field and chose 0 decimal places with no such luck.

 

I found this post, but not sure I understand how to accomplish this - https://powerusers.microsoft.com/t5/Using-Flows/sharepoint-caculated-columns-showing-13-decimal-plac...

 

Here is my formula

 

=IF(ISERROR(DATEDIF([From Date],[To Date],"d")),"",(DATEDIF([From Date],[To Date],"d"))+1-INT(DATEDIF([From Date],[To Date],"d")/7)*2-IF((WEEKDAY([To Date])-WEEKDAY([From Date]))<0,2,0)-IF(OR(AND(WEEKDAY([To Date])=7,WEEKDAY([From Date])=7),AND(WEEKDAY([To Date])=1,WEEKDAY([From Date])=1)),1,0)-IF(AND(WEEKDAY([From Date])=1,(WEEKDAY([To Date])-WEEKDAY([From Date]))>0),1,0)-IF(AND(NOT(WEEKDAY([From Date])=7),WEEKDAY([To Date])=7),1,0))

 

Total Days:3.00000000000000

 

Thanks,

 

Derek

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Calculated SharePoint field in Flow email showing extra 0's

Hi @derk,

 

Why don't you use this:

 

first(split(triggerBody()?['Difference'],'.'))
 
In my case Difference is the calculated field.
 
 

View solution in original post

11 REPLIES 11
Super User
Super User

Re: Calculated SharePoint field in Flow email showing extra 0's

Hi @derk,

 

Why don't you use this:

 

first(split(triggerBody()?['Difference'],'.'))
 
In my case Difference is the calculated field.
 
 

View solution in original post

derk Helper I
Helper I

Re: Calculated SharePoint field in Flow email showing extra 0's

Hi @Pieter_Veenstra

 

I tried to put this in and it's telling me invalid expression.

 

first(split(triggerBody()?[‘Total Days’],’.’))
Super User
Super User

Re: Calculated SharePoint field in Flow email showing extra 0's

Hi @derk,

 

Can you make sure that you have the correct quotes? you should only have ' and no `

Super User
Super User

Re: Calculated SharePoint field in Flow email showing extra 0's

Hi @derk,

 

Can you make sure that you have the correct quotes? you should only have ' and no ` 

 

I would type first(split( in the express window. Then switch to the Dynamic contents tab and click on the calculated column. That will ensure that you have the right quotes.

 

derk Helper I
Helper I

Re: Calculated SharePoint field in Flow email showing extra 0's

okay, so that let me save the expression.  I tested and it still shows the .0000 in the email. I kept total days in the details of the email. Do I need to select something different?

Super User
Super User

Re: Calculated SharePoint field in Flow email showing extra 0's

Can you submit a screenshot of both the run history and the flow in edit mode?

Highlighted
derk Helper I
Helper I

Re: Calculated SharePoint field in Flow email showing extra 0's

I figured it out. I had to add the expression to the details email instead of the Total Days field.  Thank you for your help!

 

msflow.png

Super User
Super User

Re: Calculated SharePoint field in Flow email showing extra 0's

I would probably reference the output from Compose 2 in your email. That way you separate the complicated stuff from the doing stuff.

derk Helper I
Helper I

Re: Calculated SharePoint field in Flow email showing extra 0's

@Pieter_Veenstra  how would I do that?

 

Super User
Super User

Re: Calculated SharePoint field in Flow email showing extra 0's

Click in you email body text that you have at the moment so that the cursor is in the place where you want the output from the compose to appear.

 

Then go to the dynamic content tab and add the output from the compose action ( you migth have to click on the show more link) 

derk Helper I
Helper I

Re: Calculated SharePoint field in Flow email showing extra 0's

that was it. I didn't click on see more. Thanks. 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,437)