cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nhafala
Frequent Visitor

Auto email reply filter

I created a flow to send email replies. However, I noticed that microsoft flow repeatedly tries to send replies to non repliable addresses. To go around that problem, I added the following condition:

 

@or(not(contains(triggerBody()?['From'], 'noreply')),not(contains(triggerBody()?['From'], 'donotreply')),not(contains(triggerBody()?['From'], 'no-reply')),not(contains(triggerBody()?['From'], 'postmaster')))

f2MADK9

 

So if the email address does not contain any of those terms, the flow continues on to the next steps.

 

The problem is the code works for all included terms except "postmaster" and I can't figure out why.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Auto email reply filter

Hi @nhafala ,

 

I afraid that your expression is wrong,you should use the and function instead of the or function, the expression should as below:

@and(not(contains(triggerBody()?['From'], 'noreply')),not(contains(triggerBody()?['From'], 'donotreply')),not(contains(triggerBody()?['From'], 'no-reply')),not(contains(triggerBody()?['From'], 'postmaster')))

Please let me know if your problem could be solved.

 

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

2 REPLIES 2
Dual Super User
Dual Super User

Re: Auto email reply filter

Hi @nhafala 

 

Your condition is correct

One caveat with contains is it is case sensitive

 

So if email is Postmaster then contains will return false since your are comparing with lower case postmaster

Try this if porblem is with case sensitivity

 

@or(not(contains(triggerBody()?['From'], 'noreply')),not(contains(triggerBody()?['From'], 'donotreply')),not(contains(triggerBody()?['From'], 'no-reply')),not(contains(toLower(triggerBody()?['From']), 'postmaster')))

 

Regards,

Reza Dorrani

 

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

 

Community Support
Community Support

Re: Auto email reply filter

Hi @nhafala ,

 

I afraid that your expression is wrong,you should use the and function instead of the or function, the expression should as below:

@and(not(contains(triggerBody()?['From'], 'noreply')),not(contains(triggerBody()?['From'], 'donotreply')),not(contains(triggerBody()?['From'], 'no-reply')),not(contains(triggerBody()?['From'], 'postmaster')))

Please let me know if your problem could be solved.

 

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

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,082)