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 Apps / PowerAutomate Flow wit...
Power Apps
Unanswered

PowerAutomate Flow within PowerApps fails: Code: 502 - badgateway - the server did not receive a response from an upstream server

(0) ShareShare
ReportReport
Posted on by 8

Hi, 

 

The requirement is to select multiple items from a PowerApps gellery, with one click batch print the selected items and each item has to be on a separate page. The data source is on-prem-MSSQL.

 

Below is the Full Error followed by PowerApss print button code followed by the PowerAutomate Flow screenshots. 

The goal below is to take the final HTML result with page breaks and Print. Id appreciate any feedback, I have been struggling with this for a few days. 

 

 

Full error:

 

myflow.run failed: { "error": { "code": 502, "source": "002.azure-aiuim.net", "clientrequestid": "5cee04e8-f213-454b-98b8-7765675764", "message": "badgateway", "innererror": { "error": { "code": "noresponse", "message": "the server did not receive a response from an upstream server. request tracking id '0858510376183496110cu176'." } } } }

 

PowerApps Button code

 

 

// On the OnSelect event of the Print button

// Initialize a collection
ClearCollect(colData, {});

// For each item in your gallery that is selected (checkbox is checked), append its data to the collection
ForAll(
Filter(Gallery.AllItems, Checkbox.Value = true),
Collect(
colData,
{
Field1: ThisRecord.Field1,
Field2: ThisRecord.Field2
}
)
);

FlowName.Run(JSON(colData));

 

 

 

Power Automate Screenshots 

daryshok_3-1691273834430.png

daryshok_5-1691274243114.png

 

 

Thanks so much 

Daryoush 

 

 

 

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @daryshok 

    1. Try to test simple hardcoded collection for colData. Same error?
    2. Try with another Flow from scratch, maybe the error goes away. Or to shortcut this, just open the existing Flow, click on Save As, just give another name. Then use that new Flow in Power Apps see if it works. 

  • daryshok Profile Picture
    8 on at

    @poweractivate 

     

    I tried Save As and I also tried hard coding the collection but it throws the same error. Could this be a connection or admin issue? I have not used PowerAutomate within PowerApps on this tenant before.  Thanks

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @daryshok Try and go to Connections from make.powerapps.com

    poweractivate_0-1691341875194.png

     

    Look for any Connections you suspect may be in your Flow or Canvas app, or may be causing the issue, and then press "Delete"

    poweractivate_1-1691341936062.png

    Then, try and create the Connection again, which is usually by going in the Flow and seeing if there are any yellow triangles, or simply running the Flow or testing the Flow and being prompted to sign in or authenticate again which creates the new connection.
    See if this may help as starting point @daryshok 

     

  • daryshok Profile Picture
    8 on at

    @poweractivate 

     

    I removed a couple connections that were there. But I am not using those connections anymore. The error is still the same. It does not seem related to the Flow or to the Code in PowerApps. Any instantiation of PowerAutomate(myFlow.Run()) seems to fail. Could it be my PowerAutomate permissions? Appreciate your responding. 

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard