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 / When an user clicks on...
Power Automate
Answered

When an user clicks on a specific Sharepoint button , I want to be notified with a mail giving me the UPN of the user

(0) ShareShare
ReportReport
Posted on by 13

Hello,

I've build a flow beginning with a "When a HTTP request is received" trigger and on a sharepoint page , there is a button which is linked to this flow.

I want that when an user clicks on this button, an email to be sent to me with the UPN (user principal name) of the user. 

I'd tried to get this UPN with the  "Get my profile V2" action , but it retrieves only my own profile and not the profile of the connected user. 

There is the "Get the user profile V2' action , but it needed the UPN as an input !

Thank you  very much for your help

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

     @PYL ,Is this a SPFx webpart?

    You will need to pass the context of the user clicking the button as a parameter to the Flow in the body text. 

    BODY:

    {

    "UPN":"Pass the value here."

    }

    If this is SPFx, you can get the value from sp.web.currentUser()

     

     

  • PYL Profile Picture
    13 on at

    Thank you @SudeepGhatakNZ 

    The button is just a simple SharePoint Webpart. I do not know what is a SPFx Webpart. 

    If it not the case, have you got an idea ?

    Thanks

    PYL

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Can you please share a screen shot of your SharePoint webpart that you are referring to?

     

  • PYL Profile Picture
    13 on at

    Hi @SudeepGhatakNZ 

    here is the screen shot of my SharePoint webpart . it is the simple button webpart. 

    Thank you

    PYL

    Capture d’écran 2024-03-14 145731.png
  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @PYL ,

    The approach of simply adding a button to a SharePoint page and expecting it to pass the user's context directly to a web service will not work because SharePoint does not inherently provide a mechanism for automatically capturing the user's context and passing it along with a button click event.

    Options:

    1. For scenario you are describing, you need to build a custom webpart (SPFx Webpart),or

    Overview of the SharePoint Framework (SPFx) | Microsoft Learn

    2. You build a embedded power app and add a button to it.

    Solved: Pass data from PowerApps to MS Power Automate (Flo... - Power Platform Community (microsoft.com)

    In both cases, pass the user context to flow when the button is clicked.

     

     

  • PYL Profile Picture
    13 on at

    @SudeepGhatakNZ 

    Thank you for your input : I choose solution 2 !

    I'vee also seen today  this post by @Expiscornovus on his blog : E-mail Me button on page

    Thanks

    PYL

     

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Perfect

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard