web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Call user email from p...
Power Automate
Unanswered

Call user email from powerapps into flow

(0) ShareShare
ReportReport
Posted on by 588

Users can click a button in my powerapp to create an export of a record which is then emailed out. I am however having difficulty working out how to send the email to the user who requested the export. 

 

I tried using a 'get user profile' Office action and 'Ask in Powerapps' but it didn't work as that appeared to be pulling out the ID. I'm sure I'm missing something.

 

Is there any way I can get my flow to recognise the email of the person who triggered it and send the email to that person?

 

Thanks,

Categories:
I have the same question (0)
  • Verified answer
    misc Profile Picture
    588 on at
    Re: Call user email from powerapps into flow

    Typically, I worked it out!!

     

    I did just need to select 'Ask in Powerapps' in the 'Send To' part of 'Send an Email' but what I missed was that I needed to add a second parameter to the Run() function so first it grabbed the ID of the record, and then it grabbed the email, so it ended up as an issue on the App end not automate: 

    'Copyof-createincidentreportexport'.Run(ThisItem.ID, varUserEmail);

     

  • FollowTheLion Profile Picture
    52 on at
    Re: Call user email from powerapps into flow

    I think I may have found a better way to get the email address of the user clicking on the button to use in Power Automate.  I'm using the PowerApps (V2) trigger, which I think is the same as you.  The trigger produces an output that can be queried.  The 'body' portion of the output from the trigger is what you're typically referencing (contains the values of the trigger parameters, such as 'Text" and "Text_1', etc.), but there is also a 'headers' section in that structure.

    You can either parse that whole structure and get easy access to a bunch of potentially useful information, or you can directly reference the information you're looking for.  If you want to parse, just look at the Output from the Trigger in a recent execution.

     

    If you want to directly reference the email, then here it is:

    To get email: @{triggerOutputs()?['headers']?['x-ms-user-email']}

    To get user's name: @{triggerOutputs()?['headers']?['x-ms-user-name']}

    There's a lot of other metadata in that header that could be useful.

    I hope this helps someone.

     

     

     

    I believe this gives you the email address of the user that clicked the button.  There's a lot of detail in the header structure that's worth looking through, including their name as well.  I hope that helps.

    If you wanted to customize it to go to any email based on a selection in PowerApps, then the workaround method already suggested will do that.  B

     

  • AN-31011359-0 Profile Picture
    on at
    Re: Call user email from powerapps into flow

    Where might I find more info on the "headers metadata?" Specifically, if I'm looking for the User Profile UPN?

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard