Power Automate: Automatic Reply When Out of Office

Originally Posted 10/30/23

image of the power automate logo and the outlook logo. Power automate looks like a multicolored blue arrow pointing right, and outlook looks like a blue envelope with a letter coming out of it

The Problem

So the job I have uses Microsoft for everything. One thing in Outlook I have not messed around with much is the "Out of Office" auto replies. The standard way to get to this feature (with the online version of outlooks) is to go to the settings menu, then "Automatic Replies", turn it on, and put in the date and time range you'd like an automatic reply to go out. I believe this is also where you would setup what you want the automatic reply to be.

The issue with this, from a quick Google, is that you can only set this up one at a time. So it's not a great idea to setup the auto reply that far in advance, given you'll probably have to set auto reply for something else in the mean time. This seemed odd to me that automatic replies could not just enable itself by referencing my calendar, which would have the data when I'm "Out of Office" already.

This is where I thought about Power Automate.

The Solution

If you're unfamiliar, Power Automate is a workflow automation tool (similar to Zapier or IFTTT) but designed by Microsoft and I believe only works within Microsoft apps (I might be wrong about that). So it seemed possible to me that Power Automate would be able to bridge this gap that is seemingly not native to Outlook itself. For anyone else interested in doing something similar, my automation is as follows:

  1. When a new email arrives (V3)
    • Folder: Inbox (Or whichever folder you'd like it to monitor)
  2. Get calendar view of events (V3)
    • Calendar ID: Choose whichever calendar you want it to reference
    • Start Time: "Received Time" from step 1
      • You'll want to choose this from the "Add Dynamic Content" option
    • End Time: "Received Time" from step 1
    • Explanation: I was a bit confused on the Start and End time, but after some Googling and ChatGPT-ing, my understanding is it's checking for all events that are between the start and end time of what you've chosen. It will also include all day events in its search.
  3. Apply to Each
    • Note: I suggest using "Control", "Condition", and in "Choose a Value" put in "Show As" (Dynamic Content) instead of using the "Apply to Each" step to begin with . This will automatically make a parent step of "Apply to Each" with the correct input of "Value" for "Select an output from previous steps".
    • Value 1: "Show As" (Dynamic content) is equal to oof
      • Note: You'll have to manually type "oof" which stands for "Out of Office"
      • This means if an event is labeled as "Out of Office" (also called "Away" for the online version of Office), then this process will continue down the "If Yes" path
    • Value 2: For me, I have another condition so that this does not go off for some automated emails I get from my job (I wouldn't want a sort of feedback loop). You can add anything you'd like to exclude from these rules here by adding a row, and setting up the variable as you'd like
    • Note: Make sure to check the checkboxes next to each row in the condition that you would like to be active when you save the automation
  4. If Yes Column (Under the "Condition" section above)
    • Reply to email (V3)
      • Message ID: Message ID (Dynamic Content)
      • Body: Put whatever you would like your out of office email to say
    • Mark as read or unread
      • Note: This is important because otherwise it will mark all your emails it replied to as read. If this does not bother you, you can just not include this step
      • Message ID: Message ID (Dynamic Content)
      • Mark As: No
  5. If No Column (Under the "Condition" section above)
    • Leave this whole thing blank

Save and you should be good to go!

Wrap Up

In case it wasn't clear, what this automation is doing is when an email comes in, it'll check your Outlook Calendar and, if you have an event where "Show As" is set to "Away" for when the email was received, it'll send an automated response that you've set.

As always, if you have any questions or comments, feel free to reach out to steventanzimedia@gmail.com.