web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Expression to check OO...
Power Automate
Answered

Expression to check OOO via mailtips no longer working, help with HTTP GET

(1) ShareShare
ReportReport
Posted on by 674
Hello,
 
So I was using this expression to check OOO status from the Mailtips :
empty(outputs('Get_mail_tips_for_a_mailbox_(V2)')?['body/value'][0]['automaticReplies']['message'])
 
This now gives the following error :
From Mailtips output :
 
 
From my search I can see this isn't on my end, it seems Microsoft likely made some changes, at least what I can tell from this post : https://community.powerplatform.com/forums/thread/details/?threadid=c4fdab26-e624-f011-8c4e-7c1e52466c21
 
On the above thread, David recommend to use HTTP Get? 
 
I would like to set that up, but I am unsure how? Not only do I need to rewrite the expression but I believe you have to setup an Azure Enterprise App for this? I am unsure how to do this part if anyone can walk me through it like I am dumb. I'd appreciate it.
Categories:
I have the same question (0)
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Did you check the flow output that the data doesn't have the OOO any more ? 
    outputs('Get_mail_tips_for_a_mailbox_(V2)')
    you have to confirm that the output doesn't have OOO any more, then you can consider using graph.
     
  • Verified answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I think you're asking how to make the Graph API call to check for out-of-office notifications. If so, do this:
    • Add the Microsoft Groups HTTP (or whatever the one is called that looks like the one in the image below) request action to your flow.
      • Use this for the URI value: https://graph.microsoft.com/v1.0/users/@{triggerBody()?['email']}/getMailTips
      • Set the body of the request to: {  "EmailAddresses": ["@{triggerBody()?['email']}"], "MailTipsOptions": "automaticReplies, mailboxFullStatus" }
      • Set the content type to: application/json
      • Replace the highlighted section with the dynamic value that contains the user's e-mail address.
    • Follow it with a Parse JSON action and use the body of the HTTP request for the content value.
    • Use the code below for the Scheme.
    • Add a Apply to each action after the Parse JSON action with the body.value output of the Parse JSON action.
    • What you do next is up to you, but you can include a Compose action in the apply to each and add this expression to it coalesce(items('For_each')?['automaticReplies']?['message'],'Not Set') which will either return the users OOO message if it has been set, or Not Set if it is not activated.
    The flow will look like this:
     
    Here is the scheme for the Parse JSON action:
     
    {
        "type": "object",
        "properties": {
            "@@odata.context": {
                "type": "string"
            },
            "value": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "mailboxFull": {
                            "type": "boolean"
                        },
                        "emailAddress": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "address": {
                                    "type": "string"
                                }
                            }
                        },
                        "automaticReplies": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string"
                                },
                                "messageLanguage": {
                                    "type": "object",
                                    "properties": {
                                        "locale": {
                                            "type": "string"
                                        },
                                        "displayName": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "scheduledStartTime": {
                                    "type": "object",
                                    "properties": {
                                        "dateTime": {
                                            "type": "string"
                                        },
                                        "timeZone": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "scheduledEndTime": {
                                    "type": "object",
                                    "properties": {
                                        "dateTime": {
                                            "type": "string"
                                        },
                                        "timeZone": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "required": [
                        "mailboxFull",
                        "emailAddress",
                        "automaticReplies"
                    ]
                }
            }
        }
    }
     
  • CharlesBrewer Profile Picture
    674 on at
    Hey @David_MA,
     
    Trying to follow this but I'm having trouble with the apply to each. I do not see a "body.value" so I tried both the 'body' and 'value' separately and I get an error even when trying to save it : 
    Am I missing something? Everything else looks correct.
     
    Also assuming we get that correct, how would I rewrite my Conditional?
    Basically the condition is so that if they are not OOO they get the email, if they are OOO the email goes to someone else. I had it check to see if automatic replies is empty/not but I'm not sure if that still applies here.
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I believe the issue is that you named the Apply to each action Apply to each 5. If you rename the action, which is fine, you need to be sure to make the same change in the expression. Based on the error, this expression in the compose action coalesce(items('For_each')?['automaticReplies']?['message'],'Not Set') should be coalesce(items('For_each_5')?['automaticReplies']?['message'],'Not Set')
     
    However, to ensure the expression is correct, just put the automaticReplies value in the compose action. Run your flow and make sure there are no errors. Then if you still want to use my expression, put the Compose action and copy the how the items('For each... is formatted in the code view and use that to build the expression.
     
    Of course, the easiest way to resolve this is to not rename the Apply to each action.
  • CharlesBrewer Profile Picture
    674 on at
    Hey @David_MA,
     
    First, thanks and sorry, my last question was pretty dumb and I should have noticed that. :(
     
    That part is working now, however I have another question that I am hoping is not equally done, and that's the problem where I can't do my conditional it seems with an 'apply to each' step : 
     
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    You can set up your condition like this:
     
    The expression you would use is empty(first(body('Parse_JSON')?['value'])?['automaticReplies'])
     
    This returns the first value of automaticReplies from the array that is returned from the HTTP request. Since you are only providing one e-mail address with this, there should only be one value returned. It checks if the automaticReplies is empty, which would indicate that out-of-office notifications are not enabled and would lead to the yes side of the condition.
  • CharlesBrewer Profile Picture
    674 on at
    Hah that's funny I just figured that out on my own and I was just coming back to respond.  Though I just did :
     
    empty(outputs('Parse')?['body/value'][0]['automaticReplies'])
     
    I'm not sure if that's the same as yours or not, though I tested with both an OOO and not-OOO person and it seems to be working fine. Thanks for putting up with me :)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard