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 Pages / Identify user who trig...
Power Pages
Suggested Answer

Identify user who triggered flow from power pages?

(0) ShareShare
ReportReport
Posted on by
The power pages site I'm building requires you to be logged in, and I want a button that the user can press to trigger a flow. I want the flow to identify who the user/contact is. Is this possible? I'm currently triggering a flow (trigger is When Power pages calls a flow) it via javascript, which works, and I figure I could pass the user id via liquid, but that would expose both the url for the api endpoint and the user id, which would probably mean it can be replayed, with different user ids, which is clearly not suitable.

Any other ways to make this flow work?





 
Categories:
I have the same question (0)
  • SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
     
    Yes, you're on the right track considering the security implications when dealing with user identification.  
     
    Create Power Automate flow
    HTTP Request Trigger: Set up a flow to trigger when it receives an HTTP request:
    {
       "type": "object",
       "properties": {
         "userId": { "type": "string" },
         "otherData": { "type": "string" }
       }
    }
     
     
    JavaScript to Trigger Flow: In your Power Pages custom button, use JavaScript to send the authentication token securely to the flow:
    fetch('https://your-logic-app-or-flow-url', {
        method: 'POST',
        headers: {
            'Authorization': `Bearer ${accessToken}`,  // Add the OAuth2 token here
            'Content-Type': 'application/json'
        },
        body: JSON.stringify({
            userId: getUserId(),  // Get the user ID securely
            otherData: 'some data'
        })
    }).then(response => {
        // Handle the response from Power Automate
    }).catch(error => {
        // Handle errors
    });
     
    pls try and let me know.
     
    thanks
  • Suggested answer
    Nagesh Profile Picture
    Microsoft Employee on at
    The cloud flow that got triggered from Power Pages, by default includes the contact id, web site id and site url. These parameters do not need to pass from client side and can easily track who initiated the flow

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 Pages

#1
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard