cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
nhafala
Level: Powered On

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 Team
Community Support Team

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 Team
Community Support Team

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 213 members 5,398 guests
Please welcome our newest community members: