How to set Content approval status with Power Automate

“When I use the Set Content Status Approval action to change the approval status to Approved, the Power Automate flow just hangs there with a Bad Gateway error on that action”


If you decide that the simple content approval in SharePoint is not enough, you can replace it with Power Automate flow. And in that flow you’ll use the ‘Set content approval status’ to update the status at the end. You probably won’t encounter any problems if a SharePoint library allows only major versions. But once you allow minor versions, the action can cause problems. The action might end with “BadGateway” and the whole flow will fail.

Power Automate content approval status

What’s the problem?

When setting the content approval status, it must go in a specific order. The document starts as ‘Draft’. Once it’s submitted for approval, it’ll go into ‘Pending’ status. From there it can be ‘Approved’ or ‘Rejected’. You can’t skip the order. If document is in ‘Draft’, you can’t approve nor reject it directly. It must be in the ‘Pending’ status before that.

That’s very often the problem. If you’re building your own approval flow, you must go through all the states. Don’t approve/reject directly, set the status ‘Pending’ with the ‘Submit’ action first.

Document update in the flow

It’s not only at the beginning of the flow to inform users, you should update the status after each update. If you enable content approval and minor versions, then each update will turn the document back to ‘Draft’. Even updates by Power Automate. And as already explained above, you can’t approve/reject document directly from ‘Draft’ status. The content approval process must always follow the same steps: Draft -> Pending -> Approved/Rejected. Translated to the ‘Set content approval status’ action: (create/update) -> Submit -> Approve/Reject.

Summary

If you use Power Automate flow to replace the standard content approval process, you must follow the status order. If document is in status ‘Draft’, you must ‘Submit’ it for content approval. Only documents in ‘Pending’ status can be approved or rejected. And the important point – each update in the flow will turn the document back into ‘Draft’. That means you must set it back to ‘Pending’ before the final approval/rejection.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

4 Comments

Add a Comment

Your email address will not be published. Required fields are marked *