cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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

 

Highlighted
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

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,595)