cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mosturl
New Member

FLOW TO SEND EMAIL WHEN DATE APPROACHES

I need to pull information from a sharepoint library that contains a calculated column(Date only) for "Next Review Date".  I'm trying to compare that to today's date and if equal, send a reminder email.  

 

The issue is I cannot get the comparison to work.  I'm using 

 

 

@equals(items('Apply_to_each')?['Next Review Date'], utcNow())

 

 

I've played with the date formats on my "Next Review Date" column and the utcNow() field and NOTHING is working?  Any help is greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yuazh-msft
Community Support
Community Support

Hi @mosturl,

 

I have made a test on my side and have created a sharepoint list with a alculated column(Date only) "Next Review Date" as below:

Capture.PNG

 

I have created a flow as below:

Capture.PNG   

 

The expression in the Condition as below:

@equals(formatDateTime(items('Apply_to_each')?['Next_x0020_Review_x0020_Date'], 'yyyy/MM/dd'), formatDateTime(utcNow(), 'yyyy/MM/dd'))

 

The flow would run successfully as below:

Capture.PNG

 

 

 

Bset regards,

Alice

 

View solution in original post

5 REPLIES 5
MarkStokes
Skilled Sharer
Skilled Sharer

The equals will be doing a string compare on the two dates and they are unlikely to match.

What I do here is create two compose actions and put one date in each. Then run the Flow. You’ll see what the string value of each date is and where they don’t match.

Then you might get yourself into re-composing the string values of the dates to formats that match.

Or you could try looking at the DateDiff function.

- Mark

MarkStokes
Skilled Sharer
Skilled Sharer

Another suggestion is to not pull all the items out of the SharePoint list, but put the filter onto the Get Items call and pass it a ReviewDate eq '2018-08-21' OData filter (Filter Query option)

v-yuazh-msft
Community Support
Community Support

Hi @mosturl,

 

I have made a test on my side and have created a sharepoint list with a alculated column(Date only) "Next Review Date" as below:

Capture.PNG

 

I have created a flow as below:

Capture.PNG   

 

The expression in the Condition as below:

@equals(formatDateTime(items('Apply_to_each')?['Next_x0020_Review_x0020_Date'], 'yyyy/MM/dd'), formatDateTime(utcNow(), 'yyyy/MM/dd'))

 

The flow would run successfully as below:

Capture.PNG

 

 

 

Bset regards,

Alice

 

View solution in original post

GabrielStJohn
Microsoft
Microsoft

Hello, @mosturl!

 

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-yuazh-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Hello all

 

Hope you can help please. 

 

I've created a similar Flow and need some help, I need Sharepoint to Send an email to alert -60 days before Next Review Date.

 

The email comes through with the correct details, but it just comes back with all documents in that field rather than 60 days before.

 

Can this also be set global over all sites or per folder? 

 

String being used when on advanced: @not(equals(items('Apply_to_each')?['Next_x0020_Review_x0020_Date'], formatDateTime(adddays(utcnow(), -3), 'yyyy-MM-dd')))

Over Due Date 1.pngOver Due Date 3.pngDue Date 4.png

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,893)