cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
topness
MVP

Get mail tips for a mailbox (V2) - action not returning automaticReplies

I'm using "Get mail tips for a mailbox (V2)" in an attempt to determine if a user has their Outlook 365 Automatic Replies turned on by checking if the "Automatic replies message" property is empty.

 

When I use the "Automatic replies message" property from Dynamic Content, it yields: body('Get_mail_tips_for_a_mailbox_(V2)')?['automaticReplies']?['message']

 

flow1.png

 

For me this is evaluating to null/empty, even when Automatic replies are turned on.

 

When I remove the ? operators in this statement, i.e: body('Get_mail_tips_for_a_mailbox_(V2)')['automaticReplies']['message'], it yields this:

flow2.png

Looking at the JSON returned for the Get Mail Tips V2:

{

  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.mailTips)",

  "value": [

    {

      "mailboxFull": false,

      "externalMemberCount": 0,

      "totalMemberCount": 1,

      "deliveryRestricted": false,

      "isModerated": false,

      "maxMessageSize": 37748736,

      "emailAddress": {

        "name": "",

        "address": "admin@topness.onmicrosoft.com"

      },

      "automaticReplies": {

        "message": "<div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div></div>\r\n<div>Gone!</div>\r\n<div></div>\r\n</div>",

        "messageLanguage": {

          "locale": "en-US",

          "displayName": "English (United States)"

        }

      }

    }

  ]

}

 

Here it appears the base object, value, is an array, to get at the automaticReplies object, I have to use the expression:  body('Get_mail_tips_for_a_mailbox_(V2)')['value'][0]['automaticReplies']

 

Is this a bug or am I using it wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @topness ,

 

I have made a test on my side and the issue is confirmed on my side.

The expression for the Automatic replies message dynamic content should be :

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

However, the expression for the Automatic replies message dynamic content is wrong as below:

body('Get_mail_tips_for_a_mailbox_(V2)')?['automaticReplies']?['message']

I would post this issue to my product team, if the issue is solved, I will reply here.

 

Best regards,

Alice       

 

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

7 REPLIES 7
v-alzhan-msft
Community Support
Community Support

Hi @topness ,

 

I have made a test on my side and the issue is confirmed on my side.

The expression for the Automatic replies message dynamic content should be :

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

However, the expression for the Automatic replies message dynamic content is wrong as below:

body('Get_mail_tips_for_a_mailbox_(V2)')?['automaticReplies']?['message']

I would post this issue to my product team, if the issue is solved, I will reply here.

 

Best regards,

Alice       

 

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

Hi Alice

 

I am facing the same problem. 

 

Is there any update available on this topic?

 

BR

Peter

Hazzap
New Member

I'm facing the same issue, have you managed to get this to work @topness@v-alzhan-msft , or @PeterKuehlian ? 

@Hazzap  I last tried it about a month ago and it was behaving in the same way.

This worked for me - thanks Alice!

Does that also explain why the automatic replies message dynamic content generates a for each loop? Should only ever return one message, shouldn't it?
P.S.: This is apparently still wrong in V4!

That's right, it creates a ForAll because it is now possible to check multiple mailboxes with this action.  But that's not a bug, just a change in design.   You can use the expression I have above to retrieve the first result and avoid the ForAll: 

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

 (you'll replace "Get_mail_tips_for_a_mailbox_(V2)" with whatever your action is named in the flow.  Or you can use the ForAll to assign the result to a variable. 

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (50,472)