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?
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!
Jason, Heather & Brandi
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.
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:
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:
Please take a try with it.
Look out for new contribution recognition badges coming SOON!
Join us for the first ever Power Platform Online Conference!
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!