cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Julien2
Post Prodigy
Post Prodigy

Check if the automaticReplies is equals to null

Hello,

I have created a flow that will send approvals email when an item is created in SharePoint.

Before the flow sends the approvals email, I have an action "Get Mail Tips for a mailbox (V2)"  that will get the mail tips of a user, after that, I have added a condition that will check if this user has the Outlook 365 Automatic Replies turned on which means contains a response, it should go to the alternate approval, if it's turned off it should go to the original approval.

 

The problem is that the condition always returns false and as a result, it always sends an email to the alternate approval knowing that the automatic replies (as part of mail tips) are turned off for this user.

Please have a look at these screenshots:

Capture.PNG
Capture1.PNGCapture2.PNG

For both results of the screenshots I mentioned, the condition always returns false.

I am confused about why this problem occurs since the "null" expression check if "automatic replies (as part of mail tips)" is empty?

Can please someone explains in detail and provides an example of the following scenario?

Any help will be greatly appreciated.
Thank you!

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi!
Empty expression not working?
Try with concat('') instead... two single quotes
Not on my laptop, sorry
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @Julien2 ,

 

Please try to leave right parameters of the Conditions blank directly. Like:

104.PNG

Run history:

106.PNG

 

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

13 REPLIES 13
efialttes
Super User III
Super User III

Hi!

On the conflict Condition, try with the following instead

 

Add the following expression on the left side of your condition:

items('Apply_to_each_11')?['automaticReplies']?['message']

Add the following expression on the Right side:

empty

Use the following operator:

equals

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Pstork1
Dual Super User III
Dual Super User III

The Out of Office message change sometime last fall.  When I redesigned my checks I sued the following formula to isolate the message and test if it was null.

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


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hello @efialttes ,

Unfortunately, the "empty" expression is not valid, I have tried to select it from the dropdown, and I have tried to type it.
Here is a screenshot:

Capture.PNG
Thank you!

Hello @Pstork1 ,

Could you please provide a screenshot of which action I should use this expression?

Looking forward to your response.
Thank you!

Hi!
Empty expression not working?
Try with concat('') instead... two single quotes
Not on my laptop, sorry
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Pstork1
Dual Super User III
Dual Super User III

Here's that section of my flow. I use the formula to create the OOO variable that I then test against Null

screenshot.jpg



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hello @Pstork1 ,

Thanks for sharing a screenshot.

Unfortunately, the same problem occurs and as a result, the condition always returns false.
Please have a look at these screenshots:

Capture.PNGCapture2.PNG
Capture3.PNG
Looking forward to your response.
Thank you!

Pstork1
Dual Super User III
Dual Super User III

It's been a couple months since I ran mine last.  Let me look at the screenshots and do some testing and I'll let you know.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
v-bacao-msft
Community Support
Community Support

 

Hi @Julien2 ,

 

Please try to leave right parameters of the Conditions blank directly. Like:

104.PNG

Run history:

106.PNG

 

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

Pstork1
Dual Super User III
Dual Super User III

I went back and re-ran my Flow with Out of Office.  I had to make a change to the condition I was using.  I'm still using this to get the contents of the actual Out Of Office message in a variable or compose.

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

Then doing this for the Left side of the Condition

empty(variables('ooo')) 

So this is what it looks like.

screenshot.png

I verified that this works for both with and without an Out of Office message.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi @Pstork1 ,

Thank you for sharing an example.

Unfortunately, I cannot use an "empty" expression on my side and it says that "Expression is invalid" it's a bit strange.

I can confirm that using "concat('')" expression as @efialttes mentioned, and as @v-bacao-msft mentioned in the condition has worked as expected.

Thanks again!

Pstork1
Dual Super User III
Dual Super User III

If it is saying that the expression is invalid then there is something wrong with the syntax, not that you can't use it on the left side of the equation.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 Thank You! This helped me alot! I appreciate the information!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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 on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (62,519)