How to Convert SharePoint List Item to PDF Using Power Automate?

In Power Automate, I received a requirement to convert a SharePoint list item into a PDF. When a list item is created, the client wants a PDF automatically generated item’s details and saved in a document library.

In this tutorial, I will show you how to convert SharePoint list item to PDF using Power Automate (without premium connector). Additionally, we will see how to create a PDF from a SharePoint list using Power Automate.

Convert SharePoint List Item to PDF Using Power Automate

For this example, I created a SharePoint list called Project Details with the below column:

ColumnData Types
TitleTitle (Single line of text)
Project ManagerPerson or group
Start DateDate and time
End DateDate and time
Project StatusChoice
Technologies UsedChoice (multi-select)
DescriptionMultiple lines of text

Now follow the below steps:

1. Create an automated cloud flow. Give the flow name and select the trigger When an item is created. Also, provide the Site Address and List Name.

power automate convert sharepoint file to pdf

In this example, I used a multi-select choice column. When I retrieve it, it gives me an array, but I need it in string format for the PDF. So, I used two actions to convert the array to a string. You can follow these steps if your SharePoint list is set up like mine. Otherwise, you can skip them.

2. Then I will select that column using the select action using the below parameter:

  • From: Select the Technologies Used column from the dynamic content
  • Map: Put the below expression:
item()?['Value']
Power Automate sharepoint list item to pdf

It gives the selected choice-value in an array format.

3. Now, I need to perform a join action, which will convert the above array values into a string separated by commas. To do this, I added a join action with the parameter below:

  • From: Select the body from the select action dynamic content
  • Join with: Provide ‘,’
convert sharepointlist item to pdf using Power Automate

4. Next, I add a compose action and provide the below HTML code:

<html>
<head>
  <style>
    body { font-family: Arial, sans-serif; }
    h1 { color: #003366; }
    table { width: 100%; border-collapse: collapse; }
    th, td { padding: 8px 12px; border: 1px solid #dddddd; }
  </style>
</head>
<body>
  <h1>Project Details</h1>
  <table>
    <tr><th>Project Name</th><td>@{triggerBody()?['Title']}</td></tr>
    <tr><th>Project Manager</th><td>@{triggerBody()?['ProjectManager']?['DisplayName']}</td></tr>
    <tr><th>Start Date</th><td>@{triggerBody()?['StartDate']}</td></tr>
    <tr><th>End Date</th><td>@{triggerBody()?['EndDate']}</td></tr>
    <tr><th>Project Status</th><td>@{triggerBody()?['ProjectStatus']?['Value']}</td></tr>
    <tr><th>Technologies Used</th><td>@{body('Join')}</td></tr>
    <tr><th>Description</th><td>@{triggerBody()?['Description']}</td></tr>
  </table>
</body>
</html>
convert html to pdf power automate

5. I add a create file action in OneDrive for business. Then, provide the below parameter:

  • Folder Path: Give a folder path where you need to create the file.
  • File Name: Select the Title from the dynamic content with an HTML extension.
  • File Content: Choose output from the compose action
power automate sharepoint list to pdf

6. Now, we need to convert that HTML file to pdf. For this, I add a convert file action and provide the parameters below

  • File: Provide Id from the create file dynamic content
  • Target Type: Select the PDF from the drop-down.
generate pdf from sharepoint list using Power automate

7. Now, our PDF file is created in OneDrive. Where you store it depends on your preference. In my case, I want to store it in a SharePoint library. So, I added a create file action from the SharePoint connector using the below parameter:

  • Site Address: Provide which site you want to store.
  • Folder Path: Provide Where you wish to store.
  • File Name: Provide file name. You can give a different name, but I want the same name as onedrive.
  • File Content: Provide the File content from dynamic content.
power automate create pdf from sharepoint list

8. Next, add an action that deletes the onedrive pdf file. To do this, add a delete file action from OneDrive for business. Then, provide an ID from dynamic content.

Power automate populate pdf form from sharepoint list

Let’s save the flow and test it manually. Then, add an item to the SharePoint list.

sharepoint item convert to pdf using power Automate

When the flow runs successfully, you can check that the file has been created in PDF format in the SharePoint document library.

How to create PDF from SharePoint list in Power Automate

Then, you can open the PDF and see the result.

How to Convert SharePoint List Item to PDF using Power Automate

This way, you can convert the SharePoint list item to PDF using Powe Automate.

Create PDF From SharePoint List using Power Automate

In the example above, we saw how to convert a SharePoint list item into a PDF. If you require the conversion of multiple items from a SharePoint list into a PDF, follow the steps below.

For this example, I created a SharePoint list called Employee Review Data:

Create PDF from SharePoint List using Power Automate

1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

sharepoint list convert to pdf using Power Automate

2. Now, we will retrieve items from the SharePoint list. To do this, select the Get items action and provide the Site Address and List Name.

Microsoft flow create pdf from sharepoint list item

3. Next, add a Create HTML table action and provide the below parameters:

  • From: Provide the body/value from the dynamic content of the Get items action.
  • Columns: Select Custom from the drop-down.
HeadersValue
Employee Name
Review Date
Performance Score
Comments
Select the values from the dynamic content under the Get items action.
convert sharepoint list to pdf power automate

4. I add a create file action in OneDrive for business. Then, provide the below parameter:

  • Folder Path: Give a folder path where you need to create the file.
  • File Name: Select the Employee Review Data from the dynamic content with an HTML extension.
  • File Content: Choose output from the compose action
Using Power Automate to create PDF files from SP List Items

5. Next, select Convert file action and provide the file from the dynamic content and target type to pdf.

How to generate a PDF from a SharePoint list using Power Automate

6. After that, add the create file action from the SharePoint connector using the below parameter:

  • Site Address: Provide which site you want to store.
  • Folder Path: Provide Where you wish to store.
  • File Name: Provide file name.
  • File Content: Provide the File content from dynamic content.
Generate PDF from SharePoint list item using Power Automate

7. Next, add an action that deletes the onedrive pdf file. To do this, add a delete file action from OneDrive for business. Then, provide an ID from dynamic content.

Convert SharePoint Lists to PDF Using Power Automate

Now click on Save and run the flow manually. After the flow runs successfully, go to the SharePoint library and check whether it was created correctly.

How to Create PDF from SharePoint List using Power Automate

In this tutorial, I explained how to convert SharePoint list items to PDF using Power Automate without relying on premium connectors. The steps covered include converting a single list item to PDF, formatting the content using HTML and CSS, and handling multi-select choice columns by converting arrays into strings.

Also, you may like some more Power Automate articles:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…