Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Extract email from record string

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I'm calling a flow from Power Apps to export a list of Comments to a csv file. The flow is breaking at the point where I email the report to the user who clicked the button because it is not in the right format. I need to extract the email from this record string. In this example, I need the end result to be teresa.agustin@company.com. I figure I need to add a Compose step, but I'm not sure what the expression would be. Could someone please help me out? Thanks!

 

Email Extraction Question.png

  • tagustin2020 Profile Picture
    on at
    Re: Extract email from record string

    @grantjenkins 

    @David_MA 

     

    Thank you, Grant and David for helping me! I apologize for the delay in response. Due to multiple Pi Day parties last week, I didn't get a chance to work on this flow until the weekend. I'm capturing the email of the user via a varUser variable in my app so I ended up "Asking in Power Apps" for that information outside of the Compose statement where I was gathering info for the Collection.

     

    Enjoy the rest of your weekend!

    Teresa

  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Extract email from record string

    I can't see the exactly object you're using in your To field, but you would likely just need to add /Email to extract the email value.

     

    {
     "Person": {
     {
     "Email": "teresa.agustin@email.com"
     }
     }
    }
    
    item()?['Person/Email']

     

  • tagustin2020 Profile Picture
    on at
    Re: Extract email from record string

    @David_MA 

     

    Hello David,

     

    Thank you for the reply. I'm creating a Collection in my Power App. In that Collection, I'm capturing the user's email. I then Parse the JSON to get to the contents of the Collection, create a .cvs table, etc. The reason I am interested in mailing the report to the user is in case they have pop-ups blocked and are unable to view the Excel file that is returned to the app.

     

    Here is the OnSelect of my download icon (not technically a button). I would prefer not to Collect the email address as it wants to send multiple emails (one per comment). I wrote Compose statements to whittle it down to one email and convert the array to a string, but as previously mentioned, it isn't in the format I need. I would prefer to use your suggestion as it seems much simpler, but I am not sure how to write it into the OnSelect formula so it could be retrieved at the "Send an email" step. Can you please give me advice on how to do that? Thanks!

     

    ForAll(
     galComments.AllItems,
     Collect(
     colComments,
     {
     AuthorRole: ThisRecord.'Author Role'.Value,
     Title: ThisRecord.'Comment Title',
     Category: ThisRecord.Category.Value,
     CommentBody: ThisRecord.'Comment Body',
     CustomID: ThisRecord.'Custom ID',
     Email:varUser.Email
     }
     )
    );
    'OCFComments-ExcelExport'.Run(JSON(colComments,JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes));
    Set(varFileLink, 'OCFComments-ExcelExport'.Run(
     JSON(
     colComments,
     JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
     )
    ).filelink);Launch(varFileLink);
    Clear(colComments);
    Notify("You will receive the report via email shortly.", NotificationType.Success)

     

     

     

  • David_MA Profile Picture
    11,489 Super User 2025 Season 1 on at
    Re: Extract email from record string

    Are you saying this is from a Manually triggered flow? If so, populate it with the dynamic content User email, which is the e-mail address of the person who triggered the flow:

    David_MA_0-1678996409540.png

     

    If not, what button are you referring to that is being clicked?

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 >