cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cdf_pjr
Regular Visitor

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

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-Automa...

 

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 
1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

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,

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

6 REPLIES 6
v-bacao-msft
Community Support
Community Support

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-bacao-msft !!!

 

That worked perfectly!!!!

 

Cheers

 

Paul

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

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.

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! 😀

 

JSTARR
Frequent Visitor

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

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,417)