Publish a Major Version in SharePoint with Microsoft Flow (Set Content Approval)

Recently Microsoft released the "Set content approval status" action for Flow. This action is quite handy when you want to implement ISO 9001 document management solutions. Because it is a little tricky to use I'll give you a quick start.

Quick Start

1. Activate content approval and major and minor Versions in the document library settings
2. Create a Flow
Create for the selected item. The easiest way is to start with the following template.
3. Configure the Flow
The request manager approval template is go start for real life content approval, but for the sake of simplicity I'll clean it to a bare minimum.

  • First we submit the document for Content Approval
    This action will set document approval status from "Draft" to "Pending"
  • Next add an Approval Step (In the demo I'm going to approve, without checking the result in an condition)
  • Add the "Get file metadata" action
  • Afterwards add another "Set content approval" action and set the action to approve and it is important to set the ETag. This will publish a major version and set the approval status to approved.
  • The second part of the flow should now look like this:

When you don't specify an E-Tag the action will run without any error, but will not set the statuts to approved nor publish the major version. Many thanks to Kerem Yuceturk from Microsoft who gave me the hint.

4. Run the Flow

  • Add a new document to SharePoint Library (should be in "Draft" status)
  • And start the Flow for the selected document
  • The content approval status should now be "Pending"
  • After you have approved the content approval shoud be "Approved" and a major version was published :)