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 / Email Content Extraction
Power Automate
Unanswered

Email Content Extraction

(0) ShareShare
ReportReport
Posted on by

Hi Power Automate Community,

 

I've been trying to build a flow where I can extract the Name from email signatures. For example, an email contains below:

 

Best regards,

Jane

 

or

 

Thanks,

Jane

 

I wanted to extract the name after the comma using delimiters 'thanks,' and 'regards'. But my flow keep saying the email body is an array. Need your help on this please. 

Categories:
I have the same question (0)
  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @angel_rrm ,

    I don't know if it's the ideal solution, but it works for me. The following process is built searching for the "regards" word, it has to be replicated for "thanks".

    I'd to highlight that if you're receiving an email containing "regards" or "thanks" many time, it won't work.

     

    1. Add an "HTML to text" action providing the email body from the Trigger:

    MarconettiMarco_0-1661428180245.png

     

    2. Add a "Compose" action where putting the following expression:

    length(body('Html_to_text'))

    MarconettiMarco_1-1661428204037.png

    3. Add a "Find text position" action providing "regards," in the "Search text":

    MarconettiMarco_2-1661428277533.png

    4. Add a "Compose" action putting the following expression:

    substring(body('Html_to_text'),body('Find_text_position'),8)

    MarconettiMarco_4-1661428405968.png

     

    5. Add another "Find text position" action:

    - Text: outputs from previous Compose action;

    - Search Text: ,

    MarconettiMarco_5-1661428436485.png

    6. Add a "Compose" action putting the following expression:

    add(body('Find_text_position'),body('Find_text_position_2'))

    MarconettiMarco_6-1661428494886.png

    7. Add a "Compose" action putting the following expression:

    substring(body('Html_to_text'), outputs('Compose-AddNumbers'), sub(outputs('Compose-TotLength'), outputs('Compose-AddNumbers')))

    MarconettiMarco_7-1661428530892.png

    8. Add a "Compose" action putting the following expression:

    replace(outputs('Compose-GetName'), ',', '')

    MarconettiMarco_8-1661428571605.png

     

    Here the flow:

    MarconettiMarco_9-1661428611204.png

     

    Here the output:

    MarconettiMarco_10-1661428634912.png

     

     

     

     

     

    Please let me know if the issue is fixed.

     

    If I have answered your question, please mark my post as Solved.

    If you like my response, please give it a Thumbs Up.

     

    I may not have all the answers, but I'm curious and passionate enough to keep looking for answers and to keep sharing them.

     

    My blog site about Power Automate: https://powerautomatejoy.com/

     

    BR,

    Marco

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    Hi @angel_rrm

     

    Extracting information from an email signature like that might not be the best solution to extract the name, since there are a lot of different email signatures (unless of course you want to do this for one specific company which have a standard). 

     

    I would rather take the information from the specific email adress, put this as an expression in a compose for example: 

    replace(first(split(triggerOutputs()?['body/from'],'@')),'.',' ')
     
    Which takes the information before @, and replaces . with space. Let me know if the signatures follow a specific format, and we can look into that as well. 
     
    Edit: Seems like @MarconettiMarco came up with a good solution for this. Had the post open from yesterday, so didn't see that it was answered already 😊

    Best Regards
    Heartholme

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard