cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SylvieLet17
Responsive Resident
Responsive Resident

Send email 5 days from SharePoint Calendar Event

Hi all, 

 

I'm trying to create a flow to send an email if an event exists 5 days from today. 

I have a recurring scheduled flow that checks a SharePoint Calendar and there's a For Each with condition as follows:

 

@equals(formatDateTime(item()?['EventDate'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), 5), 'MM/dd/yyyy')) 

 

EventDate is the name of the "Start Date" field for the calendar. The flow runs successfully, but it always returns False. I have tried to change the parameters to: 1 day, 4 days, etc. but it still runs false no matter what. 

 

Any advice?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @SylvieLet17,

 

How is your flow created? Are you trying to get all the events first then filter out an event that exists 5 days from today?

 

I assume that you need to add an Apply to each and format the Start date of all the items.

 

Please check the following flow configuration for a reference.

 

Action Get items is used to get all the items form the Calendar, under Apply to each, add a Condition with the following code:

@equals(formatDateTime(items('Apply_to_each')?['EventDate'], 'MM/dd/yyyy'),formatDateTime(adddays(utcnow(),5),'MM/dd/yyyy'))

 

It works fine, items that will exist 5 days from today will be filtered out. Images for your reference:

1.PNG2.PNG

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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-yamao-msft
Community Support
Community Support

Hi @SylvieLet17,

 

How is your flow created? Are you trying to get all the events first then filter out an event that exists 5 days from today?

 

I assume that you need to add an Apply to each and format the Start date of all the items.

 

Please check the following flow configuration for a reference.

 

Action Get items is used to get all the items form the Calendar, under Apply to each, add a Condition with the following code:

@equals(formatDateTime(items('Apply_to_each')?['EventDate'], 'MM/dd/yyyy'),formatDateTime(adddays(utcnow(),5),'MM/dd/yyyy'))

 

It works fine, items that will exist 5 days from today will be filtered out. Images for your reference:

1.PNG2.PNG

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

THis seems to be working thank you Mabel!

 

It didn't seem to run this morning, but I changed the days to 2, then back to 5 and it is running again. 

I'll monitor. 

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,286)