Convert Documents Stored In SharePoint Document library To PDF Using Power Automate

Many times, there is a requirement of converting documents stored in SharePoint Document library to PDF file format.

In this article you will see few easy steps which will take a file from SharePoint document library > convert it into PDF > Notify the user via Email with attached converted PDF file

Let’s look at the high-level Automation flow, then will look at trigger and actions in detail

Fig 1.1 High level Flow Steps

As shown in Fig 1.1, let us go to

Step 1

When a file is created in SP Document library (properties only) – Choose SharePoint trigger, when a file is created (properties only)

In Fig 1.2, add the following details

  • Site address: Add site name where your document library resides
  • Library name: Add library name where your document resides

Fig 1.2

Step 2

Choose Get File Content action from SharePoint Actions this connector will get all the details of the file residing in the document library

In Fig 1.3 add the following details,

  • Site Address: Add site name where your document resides
  • File Identifier: From the dynamic content select Identifier property

Fig 1.3

Now we have the file, which is to be converted to PDF, will have to save this same file to OneDrive as we will be using OneDrive’s Convert File connector which will take the file from OneDrive and convert to PDF

Step 3

Create File connector under OneDrive for Business Actions

In Fig 1.4, add the following details,

  • Folder Path: Add the Folder path of where you want your files to be saved in OneDrive or give the root folder path “/”
  • File Name: Select from the dynamic content the File name with extension, this will save the file with the filename same as in document library
  • File Content: This will have the body of the file, so pass Body as dynamic property

Fig 1.4

Now we have the file saved in OneDrive, Let’s convert it to PDF without using any paid connector, Wo-hoo that sounds awesome isn’t it,

Step 4

We will choose OneDrive - Convert file premium connector

Add the following details in Fig 1.5,

  • File: Add the Id as dynamic content from the previous connector
  • Target: this is a File type, select PDF from the dropdown to convert to PDF

Fig 1.5

Now let’s add the converted file back to Document library, I have created another folder in same document library and storing the converted files there, you can store in another document library as well.

Step 5

Choose SharePoint – Create file connector

Add the following details in Fig 1.6,

  • Site Address: Add site name
  • Folder Path: Add Folder name if any or add root folder by adding “/”
  • File Name: Select the file name from previous connector
  • File Content: Select Body from the previous connector

Fig 1.6

Now this is an optional step, you can skip if you need, this step is notifying the creator by email along with sending the PDF file as an attachment. Choose Send an Email connector and check Fig 1.7 and fill the appropriate data

 

Fig 1.7

I hope you are excited to see the outcome, Here you go our Flow works absolutely fine.

I hope this article will clear many queries on how you can convert a File to PDF format without using any paid connectors.

I hope you all got a brief understanding of how to set up SharePoint Syntex for your tenant.

In my next article will walk you through, how you can create a Document understanding model and associate your models with SharePoint document library.

Stay tuned for my upcoming articles.

Keep Reading, Keep Sharing!


Similar Articles