cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Flow to send an email when SharePoint item is due in 7 Days

Hi All,

 

I'm currently trying to create a flow that sends an email notification when a SharePoint list item is due 7 days from today's date. I've currently tried several expressions that are pulling through the date but don't seem to be filtering out results that are due in 7 days - they're just pulling through everything that has a date. 

 

At the moment my steps are as follows:

 

- Recurrence

- Initialize Variable (Name: Alert Date. Type: String. Value: 

addDays(utcNow(),7,'MM/dd/yyyy')
-Get Items
- Appy to Each (Value)
- Condition (@lessOrEquals(items('Apply_to_each')?['RiskEventDate'], formatDateTime(adddays(utcnow(), 7)))
- If yes, send an email
 
I Have attached screenshots of my flow below.
 
Any help would be greatly appreciated.
 Flow screenshot 1.PNG
Flow Screenshot 2.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Flow to send an email when SharePoint item is due in 7 Days

Hi @DI123,

 

You could filter directly using Filter array contained in Get Items.

In the filter condition, I feel that we need to add another part. If only the setting is less than or equal to, those items that have expired will also be inclueded, so I added a part greater than or equal to.

I have made a test on my side and the flow works well. Please take a try with the following workaround.

The two expressions are:

formatDateTime(utcNow(),'yyyy/MM/dd')

formatDateTime(addDays(utcNow(),7),'yyyy/MM/dd')

Note that they have single quotes on the outside.

Image reference:

63.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Flow to send an email when SharePoint item is due in 7 Days

Hi @DI123,

 

You could filter directly using Filter array contained in Get Items.

In the filter condition, I feel that we need to add another part. If only the setting is less than or equal to, those items that have expired will also be inclueded, so I added a part greater than or equal to.

I have made a test on my side and the flow works well. Please take a try with the following workaround.

The two expressions are:

formatDateTime(utcNow(),'yyyy/MM/dd')

formatDateTime(addDays(utcNow(),7),'yyyy/MM/dd')

Note that they have single quotes on the outside.

Image reference:

63.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Regular Visitor

Re: Flow to send an email when SharePoint item is due in 7 Days

That worked perfectly.

 

Thank you!

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,747)