Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Bad Gateway error



Over the past week or two of messing around with SharePoint and Microsoft Flows, I have kept running into an error when trying to access files from outside of SharePoint (specifically through an approval process that sends a link to the person assigned the approval) or copy files over to another site/library. Is this something on my end, flow's end, or? The error is below:


Edit: I may have found the cause of the error, but I'm not sure how or why. At the very beginning in the "When an item is created" step, under inputs, I am given a library name of: 66d25bf8-7ecc-4866-ba14-ad0650bd1663. At the very end of the approval chain (after both approvals), I am given the same bad gateway error with the prompt that the item doesn't exist. I then have a different library name of: 3060e39b-f9f4-4b88-a6c3-da731b9914e7. Is the change that occurs somewhere in the library name causing SharePoint to look elsewhere to change the status of the approval request?


"error": {
"code": 502,
"source": "",
"clientRequestId": "99a56c4e-a0ef-4355-acde-b74c932f1497",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "Item does not exist. It may have been deleted by another user.\r\nclientRequestId: 99a56c4e-a0ef-4355-acde-b74c932f1497\r\nserviceRequestId: 845bc89e-a0ee-8000-5218-ed952aede969"
Community Support
Community Support

Hi @Alarson214 ,


Could you share a full screen shot on your flow configuration? I would like to know the value specified for each field.


Generally, 502 bad gateway error is temporary or transient, you just need to resubmit to try the flow again.


I have made a simple flow likes below for testing, under Inputs of the trigger, the library name is its exact name but not a GUID.

Please check the following images for a reference.



By the way, if you are working with files in SharePoint, please change the trigger to When a file is created to see if you will get the same issue.


And Yes for your question, your flow is looking somewhere else to change the status of the approval request but not the one you specified before.


Please share more details on your flow configuration to help reproduce this issue.


Best regards,



Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-yamao-msft,

Thanks for the reply. See below screenshots for the entire flow.

I will try the flow with the change to "when a file is created" to see if the issue is recreated.

All of this is being done in a subsite, if that is relevant.

Update: I tried using the "When a file is created" in SharePoint Trigger, and I am met with the same error, and it is still looking for the same library name: 3060e39b-f9f4-4b88-a6c3-da731b9914e7





Hi @Alarson214 ,


Thanks for providing the detailed screenshots.


It seems in the action Set content approval status, the library you are using is different from the one in the trigger “When an item is created”, which should be the cause of the issue.


I am afraid that you may need to use the same library within this flow so that flow could set the approval status to the corresponding item.


I have made another simple flow for your reference:



Best regards,



Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group


Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (25,942)