Automate out of office replies

Did it ever happen to you? You are finally enjoying your well deserved holiday and driving through the country with your family and suddenly an MS Teams notification pops-up followed by a couple of e-mails

Oh, oh you have forgotten to enable your out-of-office! Well this happened to me several times including last week, so time for an automated solution.

Power Automate

Power Automate, or flow as it was previously named, is part of the of the Microsoft Power Platform. This platform enables user to create awesome business processes with low-code solutions. Power Automate is basically an online workflow services that automates actions across the most common cloud apps and services.

Get into the Flow

The Flow that you will have built at the end of this blogpost will trigger 15 minutes before an event starts. So when you expect to be out-of-office at 17:00 the trigger will start at 16:45 and enable your out-of-office reply in Outlook. How cool is that!

We will start from the blank template Automated flow and select the ‘when an upcoming event is starting soon’ trigger and click ‘Create’

The Process

Now we are all set it is time to start our no code solution for automating the out-of-office replies based on our calendar items. We first need to select the calendar that is used to start our process. In this example my Calendar Id is called Calendar.

Now click on new step and select the condition action from the built-in controls. Once the Condition action is added, we can start to configure the values that needs to be evaluated.

Click in the Choose a value field and select Subject field from the Dynamic content pop-up. then select the evaluation criteria and the value that needs to be matched. In my case I choose the validate it the subject contains the value holiday But this can be anything you like. Now click on Add an action in the If yes box an select Set up automatic replies (V2) action from the Standard controls.

Configure the replies

Now that the action is added to the yes condition we can start to configure this action.

The basic fields are pretty self explainable. Just drag and drop the dynamic content dialog. This will automatically show up when you select the field.

The Internal Reply Message field is a free text box where you can compose your custom out-of-office message. It is possible to do some geeky stuff in here like creating formatting fields for date time etc.

In my example I’ve added an Expression with the following content to convert the End Time to a human readable value: formatDateTime(triggerOutputs()?['body/end'],'dd')

One your all done the Set up automatic relies (V2) action should look something like the following image.

Testing the solution

Now it’s time to test our solution. First lets validate if we haven’t made any mistakes. This can easily done by selecting the Flow Checker at the top right. If this runs without any errors you can go ahead and click the test button next to it.

Choose the first option I’ll perform the trigger action:

Now go back to your Outlook calendar and create an new event that starts within 20 minutes. Our trigger will fire 15 minutes before the event starts, so this will give us some time to create the event.

Make sure that you magic keyword that you have chosen in the condition is in the title of the event to make it all work.

Now go back to the Flow page and wait until the test result is shown.

Congratulations, you have created a fully automated out-of-office reply using Power Automate!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.