Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Parse email content

(0) ShareShare
ReportReport
Posted on by 14

Hi,

 

I've been reading various guides, but i'm unable to extract an email address from the body of an email. The email comes in the same format each time - example below

 

<p>This email has been automatically generated by the contact message system as your preferences are set to receive an email copy. Please sign in to the system to see your message sent by:

Sent By: Chris Brown
Email Address: my.email@email.co.uk


This communication contains information which is confidential, which may be privileged, and which is for the exclusive use of the intended recipient(s).
</p>

 

I'm trying to extract the text after 'Email Address: ' but don't seem to be able to.

 

Any ideas?

Thanks 

  • brownoNCYFL Profile Picture
    14 on at
    Re: Parse email content

    I have fixed it!

    split(split(outputs('Html_to_text')?['body'], 'Address: ')[1], ' This')[0]

    Thanks for all your help.

  • brownoNCYFL Profile Picture
    14 on at
    Re: Parse email content

    Thanks again @Expiscornovus.

    That's worked sort of! It's got the email address at the start, but kept the footer there... How can we strip out the text after the email address to be just left with the email address?

    image.png

  • Expiscornovus Profile Picture
    32,051 Most Valuable Professional on at
    Re: Parse email content

    Hi @brownoNCYFL,

     

    I think we are getting closer to the solution 😁

     

    It looks like the first split function can't find 'Email Address: ' string. Maybe we need to try to only use 'Address: '.

     

    Can you try this new expression:

    split(split(outputs('Html_to_text')?['body'], 'Address: ')[1], 'This communication contains information which is confidential')[0]

     

  • brownoNCYFL Profile Picture
    14 on at
    Re: Parse email content

    Thanks again @Expiscornovus, I've tweaked it and attached the error below. 
    Also added the html to text output

     

    image.pngimage.png

  • Expiscornovus Profile Picture
    32,051 Most Valuable Professional on at
    Re: Parse email content

    Hi @brownoNCYFL,

     

    First of all I made a small typo in my previous post. I changed this in the expression from outputs('Html_to_text') to outputs('Html_to_text')?['body']

     

    Secondly, can you expand that html to text action from your last flow run and check if the plain text content field contains the data you are expecting?

     

    plaintextcorrect.png

  • brownoNCYFL Profile Picture
    14 on at
    Re: Parse email content

    Thanks for your help again, I'm still getting an error though...

    image.png

  • Expiscornovus Profile Picture
    32,051 Most Valuable Professional on at
    Re: Parse email content

    Hi @brownoNCYFL,

     

    You could use the outputs of the HTML to text action.

     

    The expression would be:

     

    split(split(outputs('Html_to_text')?['body'], 'Email Address: ')[1], 'This communication contains information which is confidential')[0]

     

     

  • brownoNCYFL Profile Picture
    14 on at
    Re: Parse email content

    Sure, here's the setup...

     

    Thanks,image.png

  • Expiscornovus Profile Picture
    32,051 Most Valuable Professional on at
    Re: Parse email content

    Hi @brownoNCYFL,

     

    What actions are you using in your setup, can you share a screenshot?

     

    The code snippet I shared was just an example, it definitely needs to be changed before it works in your setup. 

  • brownoNCYFL Profile Picture
    14 on at
    Re: Parse email content

    Hi @Expiscornovus

     

    Have just tried that on a Compose, but i'm getting the following error...

    Unable to process template language expressions in action 'Compose_3' inputs at line '1' and column '23179': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#split for usage details.'.

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