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 email b...
Power Automate
Unanswered

How to extract email based on first and last name from subject or body

(0) ShareShare
ReportReport
Posted on by

I am receiving emails about course progress concerns in the following format

Subject: Course Progress Concern: student's-first-name student's-last-name

Body

My first and last name,

The Course Progress Concern item has been raised by "instructor's first and last name" for student's-first-name student's-last-name.

Item Details

XXXXXXXXXXXX

I am receiving a lot of emails in the same format and I am trying to build a flow that will extract the student's email address from the name on subject line or from the body. The flow will then send an email to the student. I am stuck at extracting the email address from the first and last name using "Get My Profile (V2)"

Any help will help a lot, and please note that I have never used expressions.

Categories:
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @JayMay,

     

    If you use the replace expression on the subject line, you can replace the start of the subject with null i.e. ''.  This will leave you with the name.

     

    replace(outputs('Compose'),'Course Progress Concern: ','')

     

    DamoBird365_0-1616004420862.png

     

    I then use the action search for users and limit the results to 1 as it will return ALL possible matches.  I have discovered from past experience that if you supply null to the search for users action it will return 1000 users.  If you have an apply to each action, this could be catastrophic, hence I recommend you limit the result to 1.

     

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


    P.S. take a look at my new blog here

  • jinivthakkar Profile Picture
    4,187 on at

    @JayMay I took the subject line in a compose and then splitting it by colon : 

     

    Here is my flow:

    jinivthakkar_0-1616005621829.png

    jinivthakkar_1-1616005668771.png

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @JayMay 

     

    How are you getting on?

     

    Damien

  • JJDelar Profile Picture
    2 on at

    @jinivthakkar 

     

    I have a similar issue. 

    I need to extract the following information from a subject that is coming formatted as: 

    • Surname, First Name, Assignment Number, Change reason, Effective Date of Change (dd/mm/yyyy)

    Would you please be able to help me setting up that split for all those different pieces? 
    I have tried to follow your suggested flow but i got lost in the separator and getting 5 different outcomes that need to go into 5 columns in my sharepoint.

    This is my 2nd day using power automate and I'm a bit lost. 

    Thanks in advance. 

  • jinivthakkar Profile Picture
    4,187 on at

    @JJDelar check this out:

    jinivthakkar_0-1632427934557.png

    Output

    Showing only output of compose 2 and compose 3

    jinivthakkar_1-1632428022105.png

    Split the subject by comma, which will give you array, then just take values by passing index in variables and pass the values to SharePoint

     

    split(outputs('Compose'),',') /*split string by comma*/
    
    outputs('Compose_2')[0] /*pass index & get values, pass from 0 to 4 and get values 1 at a time*/

     

     

    Hope this helps.

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 233 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard