How to check if an employee is Out of Office using Power Automate

I am back with another blog on Power Automate. And again a blog on request of one of citizen developer.

The requirement here is very simple. In a flow, we need to determine if a particular user is Out of Office. Depending on whether user is OOF, we would take decision to send the email to his assistant or delegate.

But how do we check if a user is out-of-office? Well very easy indeed. I send an email to a user and get out-of-office reply from the user. Quite obvious I can assume that he is out of office.

But how do we check this even before we get a response back from the user. Well, that’s where this blog can help you.

Quite unknown to a lot, there is in-fact a Power Automate action to determine that and that is ‘Get Mail tips for mailbox‘. Let’s see it in action.

For this demo I have used a instant cloud flow with manual trigger. And then used the most important action – Get mail tips for mailbox

check out of office for user in Power Automate

This action is indeed wonderful. It has a property – automaticReplies which has a message property to get the out of office message which is configured.

I used a compose action to get the same.

check out of office for user in Power Automate
outputs('Get_mail_tips_for_a_mailbox_(V2)')?['body/value'][0]['automaticReplies']['message']

The final step is to check if the message is empty or not. Depending on that, we can take appropriate action.

check out of office for user in Power Automate

That’s pretty much. Now when you run the flow and if the mailbox you are checking has out of office configured then you will be able to retrieve the message.

Few things to note here before I end

  • This works with mailboxes in the same domain. So if you are trying to validate for an email account from other company this may not work.
  • You can also check for other information like – whether the target mailbox is full, whether delivery to the mailbox is restricted or not.

Hope this helped!

Debajit Dutta
Business Solutions MVP