Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Extracting Text from Email

(1) ShareShare
ReportReport
Posted on by 49

I want to create a flow that will parse text from Outlook and then create a Salesforce record/case. I need to parse the company name from this sample text "NNB-ENS-2911 has been down for at least 30 minutes." And the company name isn't always in the same location. Thanks

  • cswanson22 Profile Picture
    49 on at
    Re: Extracting Text from Email

    I will give this a try. Thank you

  • trice602 Profile Picture
    13,807 Super User 2025 Season 1 on at
    Re: Extracting Text from Email

    Hi @cswanson22 ,

     

    I just shared this on another post and it works here too.  Essentially you will use the html to text action and turn the body of the email into text.

     

    Next you will need to use an expression like substring() in a compose action to extract the company name; the position of the company name in the email doesn't matter as long as you can identify a pattern.

     

    Again, different example, but I was looking for the work "Closed" in an email, and then based on the condition being true or false, do a subset of actions.

     

    trice602_0-1706640446076.png

     

    Without seeing the actual email, one way I may approach this is to look for the character position of the text "has been down" in the email and then use substring to get "NNB".  So continuing here, I would use one compose action to find the character position of my phrase in my email body, and another compose to get the company name:

     

    substring(outputs('Html_to_text'),sub(outputs('where_my_phrase_starts'),13),3)
     
    So if the body of the email was 777 and the phrase starts in position 100, I would get the substring of 777 characters starting in position (100-13) = 87, and get the next 3 character "NNB".

     

    trice602_1-1706640562890.png

    Again, there will be variations to consider without seeing the actual email but I find it easier to find a constant phrase within an email template and then dynamically clip the value you need.

     

     

     

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1