web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Help with body of email text filter in the condition

(0) ShareShare
ReportReport
Posted on by 12

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 

I have the same question (0)
  • efialttes Profile Picture
    14,756 on at
    Re: Help with body of email text filter in the condition

    @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

     

  • zcahwby Profile Picture
    12 on at
    Re: Help with body of email text filter in the condition

    @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?

  • efialttes Profile Picture
    14,756 on at
    Re: Help with body of email text filter in the condition

    @zcahwby 

    Can you share an screenshot of your email body?

    BR

  • zcahwby Profile Picture
    12 on at
    Re: Help with body of email text filter in the condition

    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

     

  • Verified answer
    efialttes Profile Picture
    14,756 on at
    Re: Help with body of email text filter in the condition

    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

  • zcahwby Profile Picture
    12 on at
    Re: Help with body of email text filter in the condition

    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 

  • efialttes Profile Picture
    14,756 on at
    Re: Help with body of email text filter in the condition

    @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

  • joehague Profile Picture
    2 on at
    Re: Help with body of email text filter in the condition

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard