I have searched the format and compare methods on the net from top to bottom to no avail. I know how to create the flow but I can't figure out the logic to compare MM-DD only.
USE CASE: send email when an employee's work anniversary has arrived
Thoughts on logic would be:
But, I'm just not getting the syntax correct...
1. Can you try 'MM-dd' instead of 'MM-DD' ?
@Equals( item(formatDateTime([hire date],'MM-dd'),formatDateTime(utcnow(),'MM-dd') )
2. Can you show these outputs of formatDateTime?
- output of formatDateTime([hire date], 'MM-dd')
- output of formatDateTime(utcnow(), 'MM-dd')
3. Can you show the RUN HISTORY?
Could you please share a screenshot of the configuration of your flow?
Could you please share a screenshot of the run history of your flow when the flow run failed?
Could you please explain more details about the error message?
I have made a test on my side and have created a sharepoint list as below:
I have created a flow as below:
The expression in the Condition as below:
@equals(formatDateTime(items('Apply_to_each')?['hire_x0020_date'], 'MM-dd'), formatDateTime(utcNow(), 'MM-dd'))
The flow would run successfully as below:
Ok, I have this working ... now, I did change MM-dd to MM because I only want to check the MONTH vs. MONTH and day.
@and( equals(formatDateTime(items('Apply_to_each')?['OData__x0077_q99'], 'MM'), formatDateTime(utcNow(), 'MM'), equals(items('Apply_to_each')?['Process_x002d_Status']?['Value'], 'Hired-Complete'), not( equals(items('Apply_to_each')?['OData__x0077_q99'], 'Null') ) ))
However, I need to "accumulate" anniversary records and send them in a single email. I have searched the boards and seen this done in a few ways which may change the implementation. Some folks have used filter arrays?
Three Super User rank tiers have been launched!
Features releasing from October 2020 through March 2021
We are excited to announce the launch of Power Virtual Agents Community. Check it out now!
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!