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 / Extracting Text from E...
Power Automate
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

Categories:
I have the same question (0)
  • trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at

    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.

     

     

     

     

  • cswanson22 Profile Picture
    49 on at

    I will give this a try. Thank you

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard