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 / Extract email from rec...
Power Automate
Unanswered

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

Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    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?

     

  • tagustin2020 Profile Picture
    on at

    @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)

     

     

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    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

    @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

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard