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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create a Flow when ema...
Power Automate
Unanswered

Create a Flow when email body contain a specific string ?

(0) ShareShare
ReportReport
Posted on by 16

hi

how can i create a Flow when received email body contain a specific string/text (example: "top urgent") , and send notification email to me ?

 

and to be applied only for body text before the first "From to:" , to avoid retrieving text from older emails in thread

Categories:
I have the same question (0)
  • Verified answer
    CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @Morizk 

     

    Please see the solution below -

     

    CFernandes_0-1647935610442.png

     

    I did a quick test and it works for me...

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • Morizk Profile Picture
    16 on at

    Hi @CFernandes 

     

    looks good, but i want the condition (Body contain text) to lookup only the text of the latest email on top

    as you know when you reply to an email you get older emails added to the body below , if the text "top urgent" is included in an email that was already replied to a month ago then the flow will return True, which is not what i want 

     

    so if possible to lookup only between the beginning of email to the first "From:" would work 

    or if you can suggest something else would be great 

     

  • KvB1 Profile Picture
    1,596 on at

    Can you post the output of the html to text action from when you tested?

     

    I think it should be possible to find the string that sepparates the conversation history, then split the body on this string, and then grab the first string from that array.

  • Verified answer
    CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey Mate @KvB1 

     

    I assume you are trying to Parse the content - If yes, see - https://www.youtube.com/watch?v=7tZ6bRtco3Y 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     

     

  • Morizk Profile Picture
    16 on at

    hi @KvB1 

     

    plz check below , this's a blank test email with the text i'm looking for in an older email down below (highlighted in yellow) , i believe that the string that separates the conversation history here should be the text "From:" in red 

    Untitled.png

     

  • KvB1 Profile Picture
    1,596 on at

    Yeah sure, just make sure you grab the second string in the array that you would get when splitting the text on that phrase

  • Morizk Profile Picture
    16 on at

    yes but i'm not sure how to do it , would you plz suggest a solution ?

     

    Untitled.png

  • Verified answer
    KvB1 Profile Picture
    1,596 on at

    You could use something like:

     

    split(body('HTML_to_text'),'From:')[1]
     
    In your condition
     
     
    Explanation:
    split(                                      tells PA that you want to split a string
    body('HTML_to_text')            the string you want to split
    'From:'                                   the string you want to split by
     
    The output of this will be an array of strings. By saying [1] you make PA grab the second string in the array. [0] would return the 1st, etc
  • Morizk Profile Picture
    16 on at

    hi @KvB1 

    i'm almost there , but the checker gives me an error in the split expression , i don't know why 

    Untitled.png

  • KvB1 Profile Picture
    1,596 on at

    You can see the name of the action that you want to use:

    KvB1_0-1647951947292.png

     

    In the previous screenshots you posted one what was called 'Html to text', now its 'Html to text 2'. So you have to adjust the input of what you want to split in the expression accordingly to: body('Html_to_text_2')

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard