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 Apps / BAd Gatewau error powe...
Power Apps
Unanswered

BAd Gatewau error power Apps.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
 
Hi,

 

I'm using a flow in PowerApps which selects an email template to send a email whenever the case is created. This flow works when I run it inside the power automate env. but when i try to trigger the flow its giving me bad gateway error 

 

UpdateContext({show_Notification: false});
UpdateContext({currentUser: User().FullName});
UpdateContext(
 {
 email_ccList: Concat(
 Filter(
 colAssignee,
 Case_ID = VarA.Case_ID
 ),
 Assignee_Email & ","
 )
 }
);
UpdateContext({email_Title: currentUser & " has reponed (" & VarA.Case_ID & ") in Case management tool and assigned to you"});
UpdateContext(
 {
 selectedCase_assignees: SortByColumns(
 Filter(
 colAssignee,
 Case_ID =VarA.Case_ID
 ),
 "Assignee_Sequence"
 )
 }
);
ClearCollect(
 case_allAssignees,
 {}
);
ForAll(
 selectedCase_assignees,
 Collect(
 case_allAssignees,
 {
 name: selectedCase_assignees[@Assignee_Name],
 assignee_ID: selectedCase_assignees[@Assignee_UserID],
 segment: LookUp(
 USERS,
 Users_ID = selectedCase_assignees[@Assignee_UserID]
 ).Users_Segment,
 business: LookUp(
 USERS,
 Users_ID = selectedCase_assignees[@Assignee_UserID]
 ).Users_BU,
 team: LookUp(
 USERS,
 Users_ID = selectedCase_assignees[@Assignee_UserID]
 ).Users_Team,
 expectedTime: selectedCase_assignees[@SLA_DATE1],
 dependency_text: If(
 IsBlank(selectedCase_assignees[@DependAssignee_UserID]),
 "N/A",
 "Response from "
 ),
 dependency_assignee: LookUp(
 USERS,
 Users_ID = selectedCase_assignees[@DependAssignee_UserID]
 ).Users_Team,
 isCurrent: If (
 (selectedCase_assignees[@Assignee_Email] = selected_Case.CurrentAssignee_Email),
 "Yes",
 "No"
 )
 }
 )
);

ClearCollect(TitleSetting,GetEmailTemplate.Run(5));

ClearCollect(
 SubjectSessionInfo,
 { i:0,
 value: VarA.Case_ID}
);

ClearCollect(
 BodySessionInfo,
 { i:0,
 value: VarA.Case_ID},
 { 
 i:1,
 value: LookUp(
 CASES,
 Case_ID = VarA.Case_ID
 ).Case_BU},
 {
 i:2,
 value: tempTableDetail}
);

ForAll(SubjectSessionInfo, Patch(TitleSetting, LookUp(TitleSetting, ID="5"),
 {Subject: Replace(LookUp(TitleSetting, ID="5").Subject,
 Find("{"& SubjectSessionInfo[@i] & "}", LookUp(TitleSetting, ID="5").Subject),
 Len("{"& SubjectSessionInfo[@i] & "}"), SubjectSessionInfo[@value])
 }));


ForAll(BodySessionInfo, Patch(TitleSetting, LookUp(TitleSetting, ID="5"),
 {Body: Replace(LookUp(TitleSetting, ID="5").Body,
 Find("["& BodySessionInfo[@i] & "]", LookUp(TitleSetting, ID="5").Body),
 Len("["& BodySessionInfo[@i] & "]"), BodySessionInfo[@value])
 }));

Set(emailPreview_body, LookUp(TitleSetting, ID="5").Body);
Set(emailPreview_subject, email_Title);
Set(email_currentAssignee, Drp_NewCommunication_Assignee.Selected.Assignee_Email);
Set(email_CCaddress, email_ccList);

 

 

 

 I get the following error message:

 

flow.Run failed: { "error": { "code": 502, "source": "msmanaged-na.azure-apim.net", "clientRequestId": "########", "message": "BadGateway", "innerError": { "error": { "code": "NoResponse", "message": "The server did not receive a response from an upstream server. Request tracking id '############." } } } }

 

I'm confused on why it works inside the app when I run and edit it, but it does not work outside of the app when I play it or share it.

pokhani_5-1702843419309.png

 

 

However when i run the flow from power Automate its running fine. 

 

 

 

Thanks, in advanced.

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Apparently, there isn't this action in your flow because the flow has run successfully when it was triggered separately. When you have a flow run in a Canvas App for generating or updating Collections and Variables, you will need a Respond action in your flow. 

    vjefferni_0-1702885165674.png

    The respond to an App or flow action allows you pass Text, Boolean, Number, Date, Email etc. values to your App. 

    vjefferni_1-1702885419634.png

    The Response action allows you pass all kinds of values to your App.

    Solved: Passing Parameters from a Flow to an App - Power Platform Community (microsoft.com)

     

    Best regards,

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard