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 / Use User Email for the...
Power Automate
Unanswered

Use User Email for the person that triggered the flow to Send and email(V2)

(0) ShareShare
ReportReport
Posted on by 17

Hello,

I'm very new at creating flows and I'm not a programmer.

I'm trying to create and approval flow and I want to use the e-mail address of the person that triggered the flow in Send and email (V2).
In the tests I'm doing I am the owner of the flow and the one that triggers the flow.
As a test, I used Created by in the To section the flow worked; it only fails when I use User email.

 
When I run  the flow I get this message.

Silviu_B_0-1645722348881.png

Silviu_B_1-1645722423612.png

Silviu_B_2-1645722692603.png

 

Could you tell me what I'm doing wrong?

Categories:
I have the same question (0)
  • RobElliott Profile Picture
    10,313 Super User 2025 Season 2 on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    The Sewnd an email (V2) action will always send the email from you as you are the owner of the flow. You cannot send it from someone ese unless you have "send as" proivileges on that user's email account.

     

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    Who the email will be sent from is dependent on the trigger that you use.  If you use an Automated trigger it will come from you.  If you use a manual trigger it will come from whoever triggers the flow.

  • Silviu_B Profile Picture
    17 on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    Thank you for your responses.

    The flow gets triggered by a button that I added. When I test I am the one that presses the button.
    Can you tell what I need to change in the flow so that I can use the e-mail of the person that triggered and send an e-mail back to them?

    Silviu_B_0-1645723980468.png

    Silviu_B_1-1645724080070.png

     

     

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    If its triggered by a button then whoever presses the button to manually trigger the flow should be the one the email comes from.  Try testing with a different account.

  • Silviu_B Profile Picture
    17 on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    @Pstork1 , I have asked somebody else to run the flow by pressing the button and the same thing happens.
    Any ideas on why this is happening?

  • pstork Profile Picture
    62 on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    I looked back at your original screenshot. The error you are getting is because the field you are using for the To: in the email isn't an email address.  If you hardcode that email address does the flow run?  I thought you were trying to use the email address of the person initiating the flow to SEND the email from.  But it looks like your problem is the TO.  I suspect the field you are using is some kind of a Lookup field rather than an actual email address.

  • Silviu_B Profile Picture
    17 on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    Yes, the problem is with the TO. In there I am using the User email dynamic content as I thought this would return the e-mail of the user that has started the flow.
    It seems that this is not to case.
    Is there a way extracting the e-mail of the person that started the flow and use it in the TO: section?

    It works if I hard code an e-mail or user a different dynamic content for the e-mail.

     

    Silviu_B_0-1645802336500.png

     

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    OK, now that I'm looking at the right problem I know what your solution is.  The issue is that the email address is being sent as a Base64 encoded string.  So to get the actual TO you need to use the following.

     

    base64ToString(triggerOutputs()['headers']['x-ms-user-email-encoded'])

     

    Sorry for the delay and confusion.

  • Silviu_B Profile Picture
    17 on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    @Pstork1 , thank for your help.


    So the answer is to type 

    base64ToString(triggerOutputs()['headers']['x-ms-user-email-encoded'])

    in the To: box?

    I'll ask some more questions:

    1. Can I covert the data from the User email dynamic that comes out as Base64 encoded string into an another dynamic content which I can these use in my flow for e.g. send e-mail, out fill file properties with the name of the person that started the flow?
    2. If yes, could you tell how to do it in step by step guide? Sorry, I'm very new at this.

     

  • Verified answer
    Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: Use User Email for the person that triggered the flow to Send and email(V2)

    No, you would type it into the Expressions Tab of the dynamic content box.  

    triggerOutputs()['headers']['x-ms-user-email-encoded'] 

    is the User Email Dynamic contents field.  You are just putting it through a function to dencode it. You can either use the formula wherever you want the email address or you can put the formula in a Compose or variable and use it elsewhere.  The user name etc is also encoded so you would use the same Base64ToString() to decode them.  But the field name would be different.

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard