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 / Bad Gateway error on save
Power Apps
Unanswered

Bad Gateway error on save

(0) ShareShare
ReportReport
Posted on by 67

Hello. My save icon is throwing a bad gateway error. I have checked the related posts here to no avail.

 

In my app, the same data entry form is used for a new record and to modify an existing record. I use a global variable, formtype to store whether the form should be in new or edit mode and tie the form's default mode to this variable. Also the form is split across two screens: Part 1 and Part 2. The underlying data source is a SharePoint list. I pass the data from the gallery (on a different screen yet) to the form via a global variable selecteditem=galleryname.selected. The form's item property is set to this variable selecteditem.

 

When I create a new record everything works fine. However, once I navigate away from the data entry screen for the new record, i.e. to the gallery with this new record and then select that same record for editing, make the changes and click save, I get the bad gateway error. I don't get an immediate notification of the bad gateway error, but after clicking save, the changed fields revert to their previous value (indicating that the save didn't work). I checked the SharePoint list and the changes were not saved. Then when back in edit mode of the app, I see the red x next to the save icon that says "An error occurred on the server. Server response 'In Out Clearance failed: Bad Gateway".

 

So I rebuilt the form and everything seemed fine until I tried editing a record. Then I replaced the submit form function with a Patch function and again everything seemed fine until I edited a record. Oddly, Part 2 of the form works just fine with the submit form function. Part 1 of the form has complex data types including people pickers but they work fine for a new record.

 

I really don't think it is a server problem as the error would indicate since it works for a new record and saving Part 2 of the form works. I think it is code related but can't find the culprit. 

 

Any suggestions are greatly appreciated.

 

Mark

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Mombo 

    You have an Update property that is providing an incorrect value or type for SharePoint!

    The easiest way to track it down is to run the monitor tool, submit your form, and then look at the event in the monitor tool to see what the server responded with (if it did), or the request that was made (to look for incorrect values).

     

    I hope this is helpful for you.

  • Mombo Profile Picture
    67 on at

    Randy, thanks for the suggestion. I had rebuilt the app and it worked fine (hadn't changed the update property). However when I set the defaultselecteditems property for a control tied to a choice column in SharePoint it triggered the BadGateway error. I had set the defaultselecteditems value to:

    If(formtype = "New",["Contractor"],[Parent.Default]) 

     

    Then I changed the defaultselecteditems code to:

    If(Form1.Mode=FormMode.New, {Value:"Contractor"}, Parent.Default)

    and the save worked fine, no BadGateway error.

     

    I will update the defaultselecteditems property for the remaining controls and test after each update. 

     

  • grim_mushroom Profile Picture
    on at

    And? How did it go? @Mombo 

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard