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')))
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.
Solved! Go to Solution.
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.
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
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.
How do I translate this:
@and(not(contains(triggerBody()?['From'], 'noreply')),not(contains(triggerBody()?['From'], 'donotreply')),not(contains(triggerBody()?['From'], 'no-reply')),not(contains(triggerBody()?['From'], 'postmaster')))
To a statment in the folowing:
Sorry mine is in dutch! I do not have avanced mode!
I think I found it:
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
28 | |
28 | |
26 | |
26 | |
23 |
User | Count |
---|---|
63 | |
52 | |
44 | |
33 | |
30 |