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 / 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,185 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
    87 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
    87 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

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard