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 / How To Trigger A Power...
Power Pages
Unanswered

How To Trigger A Power Automate Flow From Power Pages

(3) ShareShare
ReportReport
Posted on by 150

Hi,

 

I want to trigger A power automate flow on click of a button in power pages. I think we can do this in Powerapps as shown in the guide here https://www.c-sharpcorner.com/article/how-to-trigger-a-power-automate-flow-from-powerapps/.

 

Is it possible to do a similar thing from Power Pages?

Categories:
I have the same question (0)
  • Verified answer
    Manar Profile Picture
    72 on at

    Yes, that's very possible with HTTP request. try this

     

    1- Create a flow to be triggered with http reques, here is a link to show you how How to call Power Automate (Flow) from Power Portal using HTTP Request Trigger | Softchief Learn

     

    2- create HTML button in the web page you need the flow to be triggered

     

     

    <button id="btn" onclick="triggerFlow()">Click Here to Trigger Flow</button>

     

     

     

    3- call that flow upon the button click using javascript 

     

     

    <script>
    function triggerFlow(){
     var id = '{{user.id}}'
     var acupdate = '{ "contact" : [' +
     '{ "contactid": "' + id + '"} ]}';
     var req = new XMLHttpRequest();
     var url = "PUT THE HTTP Flow URL Here";
     req.open("POST", url, true);
     req.setRequestHeader('Content-Type', 'application/json');
     req.send(acupdate);
     console.log("Login Date has Been Captured");
    
    }
    </script>

     

     

     

  • Manar Profile Picture
    72 on at
  • Verified answer
    Nippan_Rajak Profile Picture
    20 on at

    You Can Trigger A power automate flow by clicking a button in Power Pages. Just use the 'When A HTTP request is received' Trigger When Complete Your flow It will Automatically create an API. by using that API user can trigger the automate flow.

    Just use this type of code inside a function a call the function inside the button on click:

    function demoFnc(){
    
    let xhr = new XMLHttpRequest();
    var url =
    "https://prod-24.centralindia.logic.azure.com:443/workflows/b4ba47e56a36454381250f2e43ea21d3/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=nkQoR39UW25u9kv3v01wXCGohjmD9A3CEHsrIgtY8Kw";
    var data = JSON.stringify({
    email: Email,
    optionId: uniqueId,
    });
    xhr.open("POST", url, true);
    xhr.setRequestHeader("Accept", "Application/json");
    xhr.setRequestHeader("Content-type", "Application/json");
    xhr.send(data);
    
    xhr.onload = function () {
    let response = xhr.responseText;
    console.log(response)
    }
    }

    Trigger Looks Like This:

    Nippan_Rajak_0-1673096859468.png

     

  • Verified answer
    ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @bssienes 

     

    Please follow the instructions from @Manar  and @Nippan_Rajak 

     

    In addition, The following article is also useful 

     

    https://www.alphabold.com/how-to-trigger-power-automate-flow-from-power-apps-portals/ 

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

  • enes Profile Picture
    150 on at

    @Nippan_Rajak 

     

    How can I show the response on the page? I am able to print it on the console but having difficulty putting it in HTLM tags.

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @bssienes 

     

    You can utilise your javascript variables in liquid like below. 

     

    val="{{response}}"

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

     

  • Nippan_Rajak Profile Picture
    20 on at

    Use This I think It will Solve Your Issue.

    //Suppose You have a HTML Code Like this
    //<h1 id="showResponse"></h1>
    let response = xhr.responseText;
    document.getElementById("showResponse").innerHTML=response

     

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
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard