Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Customize & Extend
Suggested answer

Power Pages does not receive Power Automate response

(0) ShareShare
ReportReport
Posted on by 6
Power Automate returns response on UI but does not return value back into Power Pages.
 
When looked at Devtools -> Network -> No response shows there as well
 
 
 
 
 
Power Automate Response
 
 
 
Categories:
  • EI-20041432-0 Profile Picture
    6 on at
    Power Pages does not receive Power Automate response
    Tried that. But got the following error
     
    TypeError: shell.ajaxSafePost(...).then(...).complete is not a function
     
     
     
  • Suggested answer
    Fubar Profile Picture
    7,930 Super User 2025 Season 1 on at
    Power Pages does not receive Power Automate response
    Are you able to try using a HTTP Response instead of the Power Pages response and see what happens.
     
    Also, could try removing the .done and .fail and instead putting a .then(function(response){....}) and seeing if anything is passed to the function (could also try .complete )
     
  • EI-20041432-0 Profile Picture
    6 on at
    Power Pages does not receive Power Automate response
    Below is the ajax call that i am using
    document.getElementById("UpdateButton")?.addEventListener("click", function (event) {
        console.log("Is this working");
       
       
        var SAP_OPOR = crc81_sap_opor_name.value;
        var LineNum = crc81_linenum.value;
        var _url = "/_api/cloudflow; -- removed the full url
     
     
      var data = {};
            data["SAP_OPOR"] = SAP_OPOR;
            data["LineNum"] = LineNum;
    //debugger;
        var payload = {};
        payload.eventData = JSON.stringify(data);
        shell.ajaxSafePost({
                type: "POST",
                url: _url,
             //   contentType: "application/json",
                data: payload,
               // "origin": "*",
               //cogs : true,
            })
     
                  .then(response => {
          // Assuming the flow returns data that you want to display
          // Display the return value in an element, e.g., with class 'description'
           const result1 = JSON.parse(response);
               debugger;
                console.log(result1);
                alert("worked 1");
                localStorage.setItem("SupplierPowerAutomateOutput1",result1["varoutput"]);
      })
     
            .done(function (response) {
                const result = JSON.parse(response);
                debugger;
                console.log(result);
                alert("worked 2");
                localStorage.setItem("SupplierPowerAutomateOutput2",result["varoutput"]);
                onSuccess();
            })
           
            .fail(function () {
               alert("failed");
            });
    });
    });

    In failure, it does return to the .fail when i force an error on the workflow that is not caught
    In the existing case. The workflow return success, so i was expecting the ajax to either get into .then or .done which would return the response from power automate

    The workflow pushes data to SAP. And my outcome is to return that message as a text onto power pages. (for the moment its a fixed value to get it functioning first)
    But as i do not get the response in the result1["varoutput"], i am not able to return it onto the front end
     
  • Suggested answer
    Fubar Profile Picture
    7,930 Super User 2025 Season 1 on at
    Power Pages does not receive Power Automate response
    If you are using something like the sample code link below, check if you may be getting something in the .failure  (your screenshot shows the call being canceled in the dev tools) the sample code doesn't capture anything in the failure 
     
     
    @ronaldwalcott from Power Pages you can make an Ajax call to trigger a Power Pages Flow, and when done should have a response if there is not another failure.
  • ronaldwalcott Profile Picture
    3,810 on at
    Power Pages does not receive Power Automate response
    Trying to understand this.
    You have some action in Power Pages calling an Automate flow and you are expecting to see the result in devtools?
    When Power Pages calls a flow it would be calling it on the server. The client would not see the response thus it would not appear in devtools. Power Pages would be the one interacting with the result. What functionality is the flow providing for Power Pages? 
     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics