cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wiredupjax
Resolver I
Resolver I

Too many decimal places in Flow msg

I have an automated announcement for work anniversaries that checks every night... the # of years is a little too specific.  I'd like to show "2"

 

Any ideas how to fix this email announcement?

 

Dear Jason,

 

Happy 2.00069856671740 Anniversary! We're so glad you've chosen to work for us!  We're looking forward to many more years with you!

 

Yours Truly,

Jason, Heather & Brandi

4 REPLIES 4
v-yamao-msft
Community Support
Community Support

Hi @wiredupjax,

 

I assume that your flow is based on SharePoint list which contains a calculated column for how many years an employee has been working at your company?

The calculated column will be considered as type of text in flow.

Please try the following workaround to see if it will meet your scenario.

There is a calculated column in the list and it is configured as rounddown(([Today]-[StartDate])/365,1) in the list.

In the flow, use the following code to get number of years without too many decimals.

first(split(items('Apply_to_each')?['Years'],'.'))

 1.PNG

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
wiredupjax
Resolver I
Resolver I

Thank you for your response. 


I fixed Sharepoint so the digits show as 2.0000000000000. However, I'm getting an error in Flow likely due to syntax. The error is: InvalidTemplate. Unable to process template language expressions in action 'Send_a_Happy_Anniversary_email_to_SP_Employee' inputs at line '1' and column '2530': 'The template language function 'split' expects two parameters: the string to split as the first parameter, the separator as the second parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#split for usage details.'.

 

Here is a screenshot of the overall flow:

Overall flowOverall flowDetailed flow and calculationDetailed flow and calculation

@v-yamao-msft,

Any thoughts on above?

Hi @wiredupjax,

 

I have some updates for you.

I have made some more research and I found that it could be simply achieved by using a float function to convert it to float number.

Insert the following code in the Body field of Send an email action:

float(items('Apply_to_each')?['CalculatedDays'])

 1.PNG

Please take a try with it. 

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,631)