Skip to main content
Community site session details

Community site session details

Session Id : JBuzRcDZN5ptrVY0SwAPag
Power Automate - Building Flows
Answered

Determine users out of office status based on mailtips - Automatic Replies on or not

Like (1) ShareShare
ReportReport
Posted on 17 Jun 2020 15:53:25 by 12

Hi,

 

I am trying to build a flow that takes differing actions based on a users Outlook out of office reply status and no matter what I try, I cannot get power automate to differentiate between a user having their Automatic Replies turned on or not.

 

I have found lots of out of date articles that don't quite reflect the capabilities available in power automate today such as this one

 

https://flow.microsoft.com/de-de/blog/canada-mailboxes-aad/

 

however I found another post that contained an update - comment from @gmellis1 

 

So, after hours combing the internet after having tried various options and testing them to no avail, it turns out that the solution is an obscure one unearthed I found not related to this scenario, but the impact of the Advanced option in Condition having been stripped off in favor of the multi-conditional prompt rows. True use the AutomaticReplies not empty expression, you need to use an expression for the value use "is equal to" and make "true" an expression as well, as follows. Then is works as expected. 

 

Field (as expression): not(empty(body('Get_mail_tips_for_a_mailbox')?['AutomaticReplies']?['Message']))

Qualifier: is equal to

Value (as expression): true

 

https://powerusers.microsoft.com/t5/Building-Flows/not-empty-body-Get-mail-tips-for-a-mailbox-AutomaticReplies/m-p/598316#M78989

 

To test this out before building out my more complex flow, I have built a very simple flow that I can trigger by posting a message in a teams chat, and the next step is to check a test users out of office status.

 

The flow is shown below

 

1.PNG

The text used for the functions is copied below

 

not(empty(body('Get_mail_tips_for_a_mailbox')?['AutomaticReplies']?['Message']))
 
 <is equal to>
 
true
 
Below is the result with the users out of office off
 
2.PNG
 
Below is the result with the users Automatic Reply on
 
3.PNG
 
As you can see, regardless of Automatic replies being on or not, the result returned is always the same?
 
I have also reviewed and edited some of the community shared flows to do the same thing as my flow - for example "Send your manager an IM in Skype for Business when out of the office" as this allows you to use edit a condition action in advanced mode which is now deprecated. I wondered if this was a possible cause? This too generates the same behaviour? 
 
Please can anyone assist?
 
Thanks
 
Paul 
  • fbsafai Profile Picture
    2 on 23 May 2023 at 09:10:51
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    hi
    this guide has been really helpful
    Ive used it to check my own automatic reply status when a form i host is submitted and if my automatic reply is turned on it sends an email to the respondent saying thanks for your submission i am out of office and will look at it upon my return.
    I am struggling with the next bit of it though
    I would like the content of the email the flow sends to be "Thankyou for your submission" "content of the Automatic reply message" as this means the recipient will know when I will return as it will say so in the automatic reply message I set up when Im away.  

    any ideas on how pull the content of my automatic reply message in to the email the flow will send

     

    Thanks in advanced


     

  • cstewart1 Profile Picture
    9 on 10 Oct 2022 at 14:02:26
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    @xtra1211 After posting my original message on this topic I also found the same thing, that you can sometimes get two different values from the mail tip when the Automatic Replies are turned off. In my case it was even on the same mailbox. I'm not 100% sure on what causes the difference.

     

    At the time I found it I was in a rush so I just created a new condition nested below, however this meant I had to replicate the action based on the condition. Fortunately it was not very complex but even still it certainly was a short term fix and something I wouldn't recommend for long term deployment as any changes have to be made in two places.

     

    However, when I looked through your message I decided to have another look and this is what I ended up with.

    cstewart1_0-1665409505320.png

    I added another row to my Condition and selected the 'Or' argument so that when either of these two expressions returns true it proceeds with the action on the 'If yes' side.

    empty(body('Get_mail_tips_for_a_mailbox_(V2)')?['value'][0]['automaticReplies'])
    empty(body('Get_mail_tips_for_a_mailbox_(V2)')?['value'][0]['automaticReplies']?['message'])

     

    Thanks @xtra1211 for your post as it gave me the idea of how to simplify my own flow and so far it has worked fine in my testing. I just thought I would also share with you and the community in case it helps anyone.

  • cstewart1 Profile Picture
    9 on 10 Oct 2022 at 13:36:03
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    @JSTARR Sorry I hadn't got back to you yet, what @xtra1211 said is a good answer to your question so I recommend having a look at his message.

  • xtra1211 Profile Picture
    18 on 07 Oct 2022 at 14:50:07
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    @jsp  the value returned by "automaticReplies" in dynamic content returns the body of the content and so it is not a boolean (true/false). so you need to test it before with a fonction that returns a boolean or a text to be compared.

     

    On my side i found that depending on the mail box targeted the returned value can either be one of the above mention cases too :

     

    "automaticReplies": {}
     
    or
     
    "automaticReplies": {
    "message": ""
    }
     
    a mix of the above solutions is working on the second kind of returned value when looking at the "message" node but not in the first one as the node is not present un the value returned:
     
    empty(body('Get_mail_tips_for_a_mailbox_(V2)')?['value'][0]['automaticReplies/Message'])
     
    To get it working in both cases I ended up doing a double test that returns a text value (not a boolean) true, false1, or false2. Then the condition goes on with comparing wether the result is false1 or false2.
    you probably can convert that to boolean values if needed ... I kept false1 and false2 to help debugging as i put that in a for each fonction for my specific case.
     
    xtra1211_0-1665154778644.png

     

     
    if(not(empty(body('Get_mail_tips_for_a_mailbox_(V2)')?['value'][0]['automaticReplies'])),if(not(empty(body('Get_mail_tips_for_a_mailbox_(V2)')?['value'][0]['automaticReplies/Message'])),'true','false1'),'false2')
     
    There are probably more clever ways to do that, but that did work for me ...
     
  • JSTARR Profile Picture
    6 on 27 Sep 2022 at 14:56:20
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    @cstewart1 Why can't I just use "automaticReplies" dynamic content with 'is equal to' 'true' for the condition instead of the expression?

  • cstewart1 Profile Picture
    9 on 18 Aug 2022 at 16:49:02
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    Hey,

    I came across a similar error myself and it looks like Microsoft have changed the output. I recommend trying the below expression instead as it worked for me. Everything else should be the same as above.

    empty(body('Get_mail_tips_for_a_mailbox_(V2)')?['value'][0]['automaticReplies'])

    As per the screenshots below Microsoft have removed "message" when there is no Automatic Reply set.

    cstewart1_2-1660841194735.png

    cstewart1_3-1660841200047.png

     

    Hope this helps! 😀

     

  • agrochowski Profile Picture
    12 on 25 Jun 2022 at 23:52:43
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    I love this question but I cannot get a resolution on this matter.

     

    agrochowski_0-1656201145750.png

     

    I am getting this error when I use the code / formula that is cited.

  • Community Power Platform Member Profile Picture
    on 03 Nov 2021 at 09:29:46
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    Thank you very much this is exactly what I needed for my flow

  • cdf_pjr Profile Picture
    12 on 18 Jun 2020 at 07:35:46
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

    Thanks @v-bacao-msft !!!

     

    That worked perfectly!!!!

     

    Cheers

     

    Paul

  • Verified answer
    v-bacao-msft Profile Picture
    on 18 Jun 2020 at 04:05:54
    Re: Determine users out of office status based on mailtips - Automatic Replies on or not

     

    Hi @cdf_pjr ,

     

    The output of Get mail tips for a mailbox (V2) action is an array, so you need to use the index to get the attribute value in the item.

    82.PNG

    empty(body('Get_mail_tips_for_a_mailbox_(V2)')?['value'][0]['automaticReplies']?['message'])

     

    Hope that makes sense.

     

    Best Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete