Flow Approvals with SharePoint Document Publishing


UPDATE: Since writing this blog, Microsoft have rebranded Flow as PowerAutomate.

Creating a Flow from a SharePoint Online document library reveals a template “request managers approval for selected file” Flow. Once configured, a Flow becomes available form the Flow menu that send starts and approval process, however it is missing one key feature. It doesn’t actually approve a draft item and publish it.

SharePoint document libraries have a feature for authoring draft documents and then publishing. Draft versions of document are only visible to the editor(s) and approvers, while users with read access only see the last published major version. For example, version 1.0 is a major version visible to all users, updating the file creates version 1.1, 1.2 etc that are visible to the editors only, once published the most recent minor version becomes version 2.0 and is visible to read only users.

Document publishing is a great feature for controlled documents, contract management systems, policies etc. It is a core feature of all supported versions of SharePoint.

This video shows how to modify the out of the box Flow adding SharePoint document publishing.

Things to be aware of:

  • Users must have edit rights to the file to run the Flow
  • This example doesn’t check the status of the item and only works if the document is draft. You could add a condition to check for this if needed.

This Flow could be extended further to generate PDF versions of a Word document or copy the approved file to a different location.

Don’t forget to Share the Flow with users who can request approval!

You may also be interested in this blog I wrote on getting signatures with SharePoint and Word.

Please subscribe to my YouTube channel for more demos.

9 thoughts on “Flow Approvals with SharePoint Document Publishing

  1. Thanks so much for this. This has really helped me as I’m new to Flow and learning as I go.
    Can you explain how you’d do this with an Automated flow please, e.g. using the SharePoint When a file is created or modified (properties only) trigger?

    1. Hi Nicola,

      You cannot trigger just on a property changes unfortunately. I’d like that option!

      the best way is to start a new flow using the SharePoint trigger. In Power Automate, choose ‘Create’ and then follow these steps:
      – Choose Automated Flow
      – Select the ‘When an File is created or modified’ (there is an Item option if you want to do this for list items)
      – This will create the basic Flow template, then add the approval steps. The easiest way is to copy the steps from the ‘Send file to Manager for Approval’ Flow
      – Add some logic to check the value against another column e.g. store current and previous values of the field you want to check has changed.

      I hope this helps 🙂

  2. Hi Steve,

    I cannot get this to work.

    The trigger that most matches your suggestion is ‘When a file is created or modified in a folder’.

    Unfortunately I can’t add a screenshot to show you but I have the following:

    Automated Flow

    Trigger: When a file is created or modified in a folder

    Get file metadata

    Get file properties

    Condition: File path is not equal to 404

    If yes: If no:Terminate

    Start and wait for an approval

    Set content approval status to Pending

    Condition: Response is equal to Approve

    If yes: If no:

    Set content approval status to Approved Set content approval status to Rejected

    Send an approval email notification Send a rejection email notification

    Can you please advise?

    Thank you.

    Nicola

  3. Hi. How do you get Modified By to show the name of the Approver instead of the name of the Requestor who generated the flow?
    How do you add a condition to check for Draft status, as you mentioned in your comments? My people keep submitting the flow in Pending instead of in Draft and it’s impossible for them to remember not to, apparently.

    1. Hi Antoinette,

      Modified By is a system value for the last person to change the document or it’s metadata. Creating a person field for the Approver value is the best way to capture the actual approver.

      If you minor versions and approvals enabled on the library, the built in approval statuses are Draft, Pending and Approved. In Power Automate once you have set an Approval status, you can get the current value “ContentApprovalStatus” to check the value.

      I hope this helps

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s