Convert SharePoint documents to PDF automatically using Microsoft Flow

convert.PNG

We’ve been waiting a lifetime (dramatic?) for this feature. And now it’s here! Sort of.

Currently, with a new “Preview” action release in Microsoft Flow, we’re able to convert documents to PDF in OneDrive for Business via workflow. While this isn’t ready for SharePoint yet, we can make it look that way for our end users. Basically:

  1. When a file is created or modified in SP
  2. Create document in OneDrive for Business
  3. Convert document
  4. Create document in SP

It’s roundabout but we get exactly the result often requested: convert SharePoint docs to PDF automatically. Here’s how to set this up. A video walkthrough is available at the bottom of this post.

My scenario: I want to “publish” meeting minutes to PDF after they’ve been approved and have them posted in a different site.

  1. In your SharePoint document library, create a sort of trigger field/column. I’ll use a checkbox named “Publish”.
    publish.PNG
  2. In Microsoft Flow, create your Flow as follows:
    1. Trigger: SharePoint – When a file is created or modified (properties only)
    2. Condition: Publish = true
      Note: You’ll need to edit this condition in advanced mode to remove the single quotes from around the word true for it to work correctly. See this post for help.
      condition
    3. If yes:
      SharePoint – get file content
    4. OneDrive for Business (ODB) – create file
      Note: add document extension (such as .docx) after filename
    5. ODB – convert file
      convert2
    6. SharePoint – create file (this can be in a different site or site collection)
      Note: add document extension (.pdf) after filename
    7. Optional:
      • SharePoint – update file properties (to copy any column data from original home to new home such as “meeting date”)
      • SharePoint – update file properties (to uncheck box on source file so that future revisions won’t incidentally publish an additional copy)

Test your flow. As you can see here, it happens so quickly (~7 seconds). Your users are sure to thank you for this time-saver.

Advertisements