cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wiredupjax
Level: Powered On

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
Community Support Team
Community Support Team

Re: Too many decimal places in Flow msg

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
Level: Powered On

Re: Too many decimal places in Flow msg

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 view.pngOverall flowfailed expecting expression.pngDetailed flow and calculation

wiredupjax
Level: Powered On

Re: Too many decimal places in Flow msg

@v-yamao-msft,

Any thoughts on above?

Community Support Team
Community Support Team

Re: Too many decimal places in Flow msg

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
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,603)