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

Send auto reply when an email is send to me during an ongoing event in my Outlook calendar

Hello everyone, 
I would like to kindly ask for an assistance, because I am stuck with my flow.

I am trying to create a flow for our part-time team. 
The use case is the following: User A is working part time from 08:00 until 14:00h. User A created a daily appointment in his Outlook calendar starting at 14:00 - 18:00h with the subject "Out of office".

User B is not aware that User A is working part time. User B sends an email to User A for example at 15:00h and then User B should receive an email (auto reply) that User A is out of the office. This should only happen when the email is sent during the appointment hours, but the appointment hours can be different, sometimes between 14:00 - 18:00, or between 15:00 - 19:00

What I did is the following:
1) When a new email arrives (V3) 
- Folder: Inbox
2) Get events (V4)
- Calendar id: Calendar
3) Apply to each
- value
4) Condition
- Subject contains Out of Office
5) If yes
- Send an email
6) If no 
Terminate

So the only issue that I have now is to figure out how to set the dynamic value of the appointment, e.g. that the email should be send only during the Appointment hours and not before or after that. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @SteIv ,

 

You could refer to screenshot below to create the flow:

1.png

 

The expression in the Filter query:

@and(contains(item()?['subject'], 'Out of Office'),greaterOrEquals(triggerOutputs()?['body/receivedDateTime'], item()?['start']),lessOrEquals(triggerOutputs()?['body/receivedDateTime'], item()?['end']))

The length expression in the Condition:

length(body('Filter_array'))

 

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
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
Community Support
Community Support

Hi @SteIv ,

 

You could refer to screenshot below to create the flow:

1.png

 

The expression in the Filter query:

@and(contains(item()?['subject'], 'Out of Office'),greaterOrEquals(triggerOutputs()?['body/receivedDateTime'], item()?['start']),lessOrEquals(triggerOutputs()?['body/receivedDateTime'], item()?['end']))

The length expression in the Condition:

length(body('Filter_array'))

 

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
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

Hello Alice, 
Many, many thanks for your assistance!

I just tested the flow and so far it is working like a charm. Good job!

I just have one additional question, if I may ask. 
I want to make sure (and also to avoid huge number of emails to be sent) that Filter query we are using here, is only looking for events, which are happening let's say "now" or only for "today", in order also to reduce the amount for events the flow is checking for. 

You think this query is doing this job?

Thanks a lot in advance! Appreciate your assistance. 🙂

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (8,654)