Hi everyone,
I have an issue with power automation through flow for my work Sharepoint document.
I am trying to compare 2 dates (one being the due date for a project), and if this date is passed, I want to send an automated email to inform someone that the date is passed.
I think that I have an issue with the format of my date in my column and the one that the power automation is using. Unfortunately, I could not find a solution that has already been shared in this forum.
Here is my column date used to reference the comparison:
And here is my automated flow:
I would like to validate this flow and condition to be able to add second conditions in the future.
Thanks a lot for your help.
Cheers,
Clem
Hi @Pstork1 ,
Thank you so much for your help. You were right; it works. My issue was that I did call out to send an email to each item if my condition was 'Yes'. I changed it to have 'send email' only, and it works.
I have added as well my second condition, and everything works fine.
Thank you so much for your precious help.
Have a good weekend,
Clem
UTCNow() is already in the right format. Adding 'u' in as a parameter either won't do anything or will return a completely wrong date/time.
The Left side should be just UTCNow() and the Right side should be
FormatDateTime(items('Apply_to_each_2')?['Date_x002b_48h'], 'u')
I would do some troubleshooting by adding a compose that contains both UTCNow() and the Date 48h value so you can see exactly what you are comparing. But I've tested this using the formula I've provided and it should work.
One other question. Why is there another loop in the Yes side of the Condition? Could that be why you are getting 3 emails instead of one?
Hi @Sundeep_Malik and @Pstork1,
@Sundeep_Malik , thank you so much for your help; I really appreciate that you tagged more people.
@Pstork1 , thank you for your answer. Unfortunately it did not work, I still received emails for dates that are greater than the current date.
I have tried multiple things:
- Only modify the right part of my condition, and replace the function with: formatDateTime(items('Apply_to_each_2')?['Date_x002b_48h'], 'u'). Result: No email received at all (I should have received 1 email).
And here are the dates that I compare with utcnow():
Edit: I did a last test by removing the time in my column and I received 3 emails, when I should have received only 1.
Thanks again for your help,
Clem
If you want to compare the output of a FormatDateTime() function with UTCNow() then you want both of them to be in ISO 8601 format. The only time you want to use a static mask like "MM/dd/yyyy" is when you are trying to remove the time portion to see if two dates are equal to each other. But to see if one is greater than the other you need to use a sortable version of ISO 8601. The formatDateTime function you want will look like this. 'u' is the code for the standard ISO 8601 universal sortable DateTimeFormat. It should always be used when doing comparisons.
formatDateTime(items('Apply_to_each_2')?['Date_x002b_48h'], 'u')
@Anonymous
I would have definitely helped if I could.
Tagging others who might be able to help.
Hi everyone,
I still have the same issue that I described in my previous answer. I tried a few things today, but nothing changed. @Sundeep_Malik, do you have an idea, please?
Also, I have added a second condition. I am using another column of my Sharepoint; if this column says "No" and the date is passed, than I want my flow to send an automatic email. But unfortunately nothing happen when both condition are applied (if I have only the date condition, an email is sent for each row of my Sharepoint document, wether the date is passed or not).
Here is my condition:
Any idea?
Thank you for your help.
Best regards,
Clem
Hi everybody,
I still have some issues with my automated flow; I would like to do a quick recap:
- I have a SharePoint document to keep track of my actions for different projects. Each action has a line.
- I would like to compare 2 dates: one is a due date for an action to be done, and one is the current day's date.
- If the current date is past the due date, an automated email is sent to remind the person that the action needs to be done.
He is my current condition:
The function is:
When I apply my condition, I receive an email for each line of my SharePoint (so for each action). And there is no distinction if the current date is past the due date or not. I have tried to change my condition from "is Greater than" to "is Less than" and the result is the same.
I have followed @Sundeep_Malik remarks but unfortunately I still have some issues.
Do anybody have an idea of my mistake(s)?
Thank you so much for your help.
Cheers,
Clem
Hi @Sundeep_Malik,
Thanks for your reply.
It did not work, as when I was double-cliquing, nothing happened. But I found a way to get the expression by copying the condition expression to the clipboard and selecting the needed part.
So my expression is:
And when I execute my automated flow, I receive 5 emails (the result of my condition) for my 5 items, while I should receive 4 (for the red dates).
Do you have any idea about this issue, please? I tried to change my condition from greater to lower, and I would receive 25 emails (multiples for the date/line), which makes me think that is not the proper condition.
Thank you for your help,
Clem
Hey @Anonymous
Sometimes it happens.
Do this:
Add the dynamic expression without function.
Double click on it. The expression would be highlighted.
Copy it with ctrl+c shortcut.
Remove it.
After doing the above, write the formatDateTime action and paste the expression at the required position.
There could be some @ {} symbols, remove them and save the expression.
Hope this will work.
Hi @Sundeep_Malik,
Thank you for your answer.
I imagine you were speaking about my condition expression (left and right side).
So I have been able to add utcNow('MM/dd/yyyy') on the right side. But when I want to add formatDateTime(urdatedynamicexpression, 'MM/dd/yyyy') on the left side, I cannot select my dynamic expression (Date+48h).
Here is a screenshot:
I am probably missing something. Any idea of what it would be, please?
Thanks again,
Clem
stampcoin
97
Michael E. Gernaey
70
Super User 2025 Season 1
David_MA
48
Super User 2025 Season 1