cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DI123
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
v-bacao-msft
Community Support
Community Support

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
v-bacao-msft
Community Support
Community Support

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

That worked perfectly.

 

Thank you!

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (15,759)