Skip to main content

Notifications

Community site session details

Community site session details

Session Id : AKzlCQ3ONTGJzjlycEJhXH
Power Automate - Building Flows
Suggested answer

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

Like (1) ShareShare
ReportReport
Posted on 25 Sep 2024 16:22:33 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:
 
 
  • Suggested answer
    BizAppBee Profile Picture
    87 on 04 Oct 2024 at 21:50:15
    How to extract only part of a line from an email (after the word email:)
    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')),' ','')
  • ASmithRouse Profile Picture
    44 on 27 Sep 2024 at 13:45:41
    How to extract only part of a line from an email (after the word email:)
    @BizAppBee 

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

  • Suggested answer
    BizAppBee Profile Picture
    87 on 27 Sep 2024 at 03:29:31
    How to extract only part of a line from an email (after the word email:)
     
    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

  • tom_riha Profile Picture
    10,085 Most Valuable Professional on 25 Sep 2024 at 18:52:25
    How to extract only part of a line from an email (after the word email:)
    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 111

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 90 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 62 Super User 2025 Season 1

Overall leaderboard