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

Help with body of email text filter in the condition

Hi 

 

I am building a straightforward flow that uses the trigger "when an email is received in a shared mailbox" to get those emails which are received where the body of the email contains a certain string of text and I'm having trouble getting this to work. When I put the condition that the email body contains "Client Name: Client"  and run a test it returns that the expression is false and I'm not sure why. I have used condition statements for seemingly more complex things in the past, and have a fairly good grasp of the basics of microsoft flow but can't seem to get this to work. I have flows that filter the subject of an email by a string of text (also from shared mailbox trigger) and these seem to be working fine so can't understand what is going wrong. I have shared a screenshot of my flow below, any help or guidance would be much appreciated. 

1.PNG

 

2.PNG

 

I have added the "Get Email" step after first trying without this step, I'm not sure if this is even necessary or not. Either way, my flow recognises the expression as false. 

 

Thanks in Advance 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi again!

So, there are several clients, i.e. Bill Gates, Nadya Satella, etc., right? If so, the text to find is not Client Name: Client !!!

I would suggest you to modify your Condition, and verify two rules instead of one:

first rule: does body contain Client Name:   ?

AND

second rule: does body contain Instruction Deadline:  ?

 

If true, then you need to use an expression to extract text between Client Name: and Instruction Deadline:

 

Please also note the email body is HTML based, so probably need to remove HTML tags just in case.

It is better explained in this thread

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

8 REPLIES 8
efialttes
Super User III
Super User III

@zcahwby 

Did you try to remove the double quotes on the Condition action block and reexecute the Flow?

"Get email" action block is not needed, since the body of the message is one the trigger's outputs

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!



@efialttes, thank you for your response, much appreciated. 

 

Unfortunately, I've tried both of those suggestions already with no such luck. Is there anything that you can see that indicates my flow is not configured properly?

@zcahwby 

Can you share an screenshot of your email body?

BR



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!



The general format of the email is below. I wonder if it could be to do with the special character ':' in the string I'm trying to filter? I made a test flow that seemed to work but this didn't contain a special character (see below screenshot for flow configuration and results).test flow config.PNGtest flow result.PNG
body.png

 

Hi again!

So, there are several clients, i.e. Bill Gates, Nadya Satella, etc., right? If so, the text to find is not Client Name: Client !!!

I would suggest you to modify your Condition, and verify two rules instead of one:

first rule: does body contain Client Name:   ?

AND

second rule: does body contain Instruction Deadline:  ?

 

If true, then you need to use an expression to extract text between Client Name: and Instruction Deadline:

 

Please also note the email body is HTML based, so probably need to remove HTML tags just in case.

It is better explained in this thread

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

Thanks for the response, there are a few nuances with this approach for my specific case e.g. sometimes the client name can be captured in the fund name but as far as the approach of looking for two or more criteria to check against I think this could work, I will just need to go away and flesh out the requirements. Thanks a bunch for the suggestion 🙂 

 

I'll mark this thread as solved and come back to it if I have any more issues 

@zcahwby 

If you find additional issues with the flow you are building, I would recommend to open a new thread and include a link to this thread, since Microsoft Support Team focus its efforts on threads that are still not solved.

BR



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!



joehague
New Member

I have had exactly this issue and it ended up being that in my condition field the string had a space at the end. Once I noticed and removed the space it worked just fine

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (54,695)