cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gmellis1
Microsoft
Microsoft

@not(empty(body('Get_mail_tips_for_a_mailbox')?['AutomaticReplies']?['Message'])) returning "The expression is invalid."

I'm trying to implement the validation of an OFF setting in a chain of approvers inboxes to find an approver in office who can be assigned using this site: https://flow.microsoft.com/de-de/blog/canada-mailboxes-aad/

 

It instructs to use "Get mail tips for a mailbox" to send the ping and return any kind of OOF message (among other data) back, and then:

Add a condition. Select edit in advanced more and add an expression like: @not(empty(body('Get_mail_tips_for_a_mailbox')?['AutomaticReplies']?['Message'])). This condition means that the next action will only run if there is an automatic message present.

 

One key note, the Condition sits within a "Do Until" loop. Not sure if that is pertinent, but just in case. 

 

Thanks

 

When i try to use a condition and enter the expression as-is, it returns: "The expression is invalid."

 

That is quite odd given that I set up a separate flow run just "Get mail tips for a mailbox" to validate what data it returns, and validated that Message, does in fact return data when i turn my personal Automatic Replies on. 

 

Any idea why this would return invalid when trying to create a condition as per the blog? Any alternative means? 

 

I've also tried a non-expression condition of "Message does not contain (does not start with, etc.) <div>" and it also doesnt seem to pick up on the presence of "<div>" even thorugh i've alo confirmed it is present in the Message output when i run "Get mail tips for a mailbox." This is critical to an approval workflow i am working on to ensure only an approver for each group that is in office is the first to get the approval request ticket. Any help is appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
gmellis1
Microsoft
Microsoft

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

 

Sorry, i can't paste an image. Since about a month or so ago, when i try to paste image, all it gives me is a "Source" field which only seems to be an open string field. The navigation option to get to and select an option is no longer available in the "Insert/edit image" button. 

View solution in original post

4 REPLIES 4
Brad_Groux
Community Champion
Community Champion

You likely have a syntax or formatting issue. If you could provide an expanded screenshot of your Flow and steps, and of any detailed error messages you're receiving we could likely better assist you.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-zhos-msft
Solution Sage
Solution Sage

Hi @gmellis1 ,

I have made a flow for your scenario, please check it for a reference.

Expression:

empty(body('Get_mail_tips_for_a_mailbox')?['AutomaticReplies']?['Message']) is not equal to ture

Capture1.PNG

Best Regards,

Community Support Team _ Zhongys

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

gmellis1
Microsoft
Microsoft

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

 

Sorry, i can't paste an image. Since about a month or so ago, when i try to paste image, all it gives me is a "Source" field which only seems to be an open string field. The navigation option to get to and select an option is no longer available in the "Insert/edit image" button. 

View solution in original post

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,519)