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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to extract only pa...
Power Automate
Suggested Answer

How to extract only part of a line from an email (after the word email:)

(1) ShareShare
ReportReport
Posted on by 44
I am attempting to extract an email address from the body of the email. I have successfully extracted the entire line that includes the email address; however, it is extracting the word "email:" as well. How do I set the expression so that only the email address (text after email:) is extracted in stead. Any insight and help is appreciated. Thank you

Picture A is the email that we receive 
Picture B is first Compose 
Picture C is the Second Compose
Picture D is the success output of the compose but includes "email" in the output which is what I am wanting to have not included. 

A:

B:
 
C:
D:
 
 
Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at
    Hello,
     
    I prefer using the split(...) expression to extract piece of text, but you can use also slice(...) or substring(...) as explained in this article.
  • Suggested answer
    BizAppBee Profile Picture
    89 on at
     
    Please try the following expression:
     
    Replace(First(Split(Last(Split(triggerBody()['text'], 'Email:')), 'Inquiry')),' ','')
     
     I did a test on my end where for the purpose of this post I created a manual trigger flow. In the trigger text parameter I used similar content as your email body and then used the above formula in a compose
     
     

    Hope it helps!

     

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

    Thank you!

    Leoza

  • ASmithRouse Profile Picture
    44 on at
    @BizAppBee 

    This is not work unfortunately. This is the error I got. 

  • Suggested answer
    BizAppBee Profile Picture
    89 on at
    Hi @ASmithRouse,  in your case, you would replace 'triggerBody()['text']' with I believe body('Html_to_text') - how you did your first compose. Sorry I should have been more clear:
     
     
    Replace(First(Split(Last(Split(body('Html_to_text'),'Email:')), 'Inquiry')),' ','')

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 785

#2
Valantis Profile Picture

Valantis 669

#3
Haque Profile Picture

Haque 563

Last 30 days Overall leaderboard