cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
delaney_langsto
Level: Powered On

502 Bad Gateway Error

This flow has been running fine for months, and now every time we try to submit on Sharepoint or the Flow tries to update the Sharepoint, we get the following error. I am not sure which field is causing this.

 

{
"error": {
"code": 502,
"source": "japan-001.azure-apim.net",
"clientRequestId": "5f24909f-19e3-470c-aa7b-a75fe6238ec7",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Microsoft.SharePoint.Connector.SPListExpandedReference' because the type requires a JSON object (e.g. {\"name\":\"value\"}) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON object (e.g. {\"name\":\"value\"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\r\nPath '', line 1, position 1.\r\nclientRequestId: 5f24909f-19e3-470c-aa7b-a75fe6238ec7\r\nserviceRequestId: 5f24909f-19e3-470c-aa7b-a75fe6238ec7"
}
}
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

@delaney_langsto 

 

I can see it here: hshs.PNG

Did you change the settings of this column that it cannot accept multiple values? Please check your SP column and update to allow mulitple selections. (please check and confirm this)

View solution in original post

15 REPLIES 15
Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

Hi @delaney_langsto 

 

From the error I am guessing there is some issue in passing a value to the Update/ Create Item in Sharepoint action in your flow. Can you please share a screenshot of the flow so that we can identify the issue properly and better assist you?

delaney_langsto
Level: Powered On

Re: 502 Bad Gateway Error

Here is the beginning of the Flow

Term 1.JPG

 

Term 2.JPG

 

Term 3.JPG

 

Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

@delaney_langsto 

 

Can you also post a screenshot of the error (At which action are you seeing that error)?

 

Looks like there is some datatype mismatch issue here but it will be easier to find that if you can post the error screenshot along with the action that the flow is breaking at. 

delaney_langsto
Level: Powered On

Re: 502 Bad Gateway Error

The Flow is actually breaking upon even trying to submit an item to Sharepoint.

Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

Hi @delaney_langsto 

 

Yes. Can you post a screenshot of one of those? Can you also share what is the datatype of the columns: 

Division Date and Division Comments on your SP list? 

 

 

delaney_langsto
Level: Powered On

Re: 502 Bad Gateway Error

Here is what happens when trying to click Save. It is the same error message as my original post.

 

Division Date = Date & time

Division Comments = Single line of text

 

Neither of these columns or any others have changed since we built this.

 

Term 4.JPG

Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

Hi @delaney_langsto 

 

This looks like an error on your sharepoint form. Are you getting any error on the flow? We need to check which column is generating the error so can you please empty all teh columns and add values and save one by one to check what the issue is and where the error is popping up?

 

Did your flow run succesfully? Can you check that?

delaney_langsto
Level: Powered On

Re: 502 Bad Gateway Error

I think we are getting somewhere - it finally let me submit after testing every field. However, it looks like the values for Person in Charge (Person or Group Field) and Dealer Divisions (Choice Field) are not being stored. And, this error was produced on the Flow run.Term 6.JPG

 

Term 5.JPG

 

Term 7.JPG

Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

Hi @delaney_langsto 

 

Perfect! So when you update the Persons field on sharepoint, do you see any error? By not updating, do you mean that it is not saving when you are making this change manually? In SP when you modify a single column, it will show saved action note on the column itself. Can you confirm this for the Choice type field too? 

 

Please note that in your flow, you will have to pass these values appropriately (In the choice column you hae to pass the choice value field)

 

Hope this Helps!

delaney_langsto
Level: Powered On

Re: 502 Bad Gateway Error

I don't see any error for Person or Divisions, but the data is not retained. I tried building a new Flow, and I have the same issue with these fields. It's weird because there are other fields of the same type on the same Sharepoint, but those don't have any issues, just those two.

Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

@delaney_langsto 

 

Here is how it works: 

For a person type column when there is only one value allowed, you need to point to the claims value and when it is multiple values allowed you can pass the array of the persons in the appropriate schema. 

 

For a choice column, you need pass the integer value of the choice. 

 

Can you update the following:

 

In the flow, on the update actions, in person incharge, remove everything and click on the icon as highlighted in the image below and select the person incharge column from the dynamic selector:update.PNG

Please make this change and run the flow. 

 

Hope this Helps!

delaney_langsto
Level: Powered On

Re: 502 Bad Gateway Error

I don't have the icon on this field or any field. I used to have it sometimes, but not anymore. I am still getting the error message about valid array from above.

Term 8.JPG

Dual Super User
Dual Super User

Re: 502 Bad Gateway Error

@delaney_langsto 

 

I can see it here: hshs.PNG

Did you change the settings of this column that it cannot accept multiple values? Please check your SP column and update to allow mulitple selections. (please check and confirm this)

View solution in original post

delaney_langsto
Level: Powered On

Re: 502 Bad Gateway Error

The column settings ended up being the issue. Thank you!

Keithy65
Level: Power Up

Re: 502 Bad Gateway Error

I now too have this error. On a flow that has had no changes in several weeks and had been working fine. Suddenly fails, yep error 502 Bad Gateway. Posting this on August 30 2019 as I have searched this error and seen posts from as far back as 2015. Only been using SharePoint online for a couple of months, initially impressed but now not so much.  NO I will not post my Flow, as is the usual request. This is obviously a bug that has still yet to be fixed properly. Can only assume it rears it's ugly head after a botched Microsoft patch.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,644)