In this flow tutorial, we will discuss how to convert HTML to PDF using Microsoft flow or Power Automate. We will see an example of how to convert SharePoint list item to pdf using flow or Power automate.
We will create a list in SharePoint Online and add some items to the SharePoint list, then we will bind it in HTML format that will convert to PDF files.
The advantage of using Power Automate in SharePoint is that we can easily integrate it with other applications using various connectors without writing any code. In Microsoft flow or Power Automate, there are almost 300 data sources (and publicly available APU) provided by Microsoft.
If you are new to flow, check out an article on What is Microsoft Flow or Power Automate.
Convert SharePoint list item to pdf using Microsoft Flow
Now, we will see step by step how to convert SharePoint list item to PDF using flow or Power Automate.
The final output: When a user creates an item a SharePoint list, S/He will receive an email that contains the PDF version of the list item.
Here we will manage the document management flow using Encodian API.
To utilize the ‘Encodian Document Manager for Flow’ connector you will require an ‘API Key‘, if you have an existing Encodian subscription but do not know your API Key please email [email protected].
If you do not yet have an Encodian subscription please create a trial subscription by completing the trial request form on our website found here.
Convert SharePoint List item from HTML to PDF file using Encodian
Step 1: Go to your SharePoint Online Site and create a list with below columns
- Employee Name
- Company Name
- Mobile No.
Step 2: Once the list got created, click on the Power Automate in the top and create a new flow “Send a Customized email when a new SharePoint list item is added”.
Step 3: Now I will add one more step after Get my profile (V2).
Step 4: Here just search Encodian and select Convert HTML to PDF. So in this step your list item will convert to PDF format.
Step 5: Now you have to provide the Encodian Connection Name and API Key. In Connection Name, you can provide anything but in API Key, you have to provide the same key that you will get when doing registration on Encodian website.
Step 6: Once you click on create, you will get the below page where you have to provide the below details.
- PDF FileName: You have to provide the file name and extension should be in .pdf format.
- File content: Optional Field
- HTML Data: This is important where you can use HTML code and bind your list item data along with you can apply the custom CSS file and image file.
Step 7: Next expand the send email and update the two fields in Attachment Name-1 and attachment content.
Step 8: Next go to your SharePoint Online list, create an item and see you will receive an email with an attachment.
Step 9: When I open the PDF file, I am able to see my list item here in PDF format.
This is how to convert SharePoint list item to PDF using Flow or Power Automate.
Power Automate create pdf from SharePoint list
In this Power Automate tutorial, we will discuss how to create a pdf from a SharePoint list of items using Microsoft Flow or Power Automate.
We have a SharePoint list called Employee Information, in this list, we will add some items. After that, we will create an HTML table using a List of items and then we will create a file with a .html extension in OneDrive for business.
At last, we will convert the HTML file to pdf, then we will create the file with a pdf extension in OneDrive for Business or SharePoint Online Library.
Steps how Power Automate create pdf from SharePoint list item
Here we will see the steps on how to create a pdf file from the SharePoint list items using Power Automate.
Step 1: Create SharePoint list
I have already created a SharePoint list called Employee Information, having 8 columns with the column type.
|Title||Single Line of text|
|HireDate||Date and time|
|DOB||Date and time|
|SIN||SIngle line of text|
Once your SharePoint list is done, we will move forward to create a flow.
Step 2: Create a Flow in Power Automate
In Power Automate, Login to Power Automate or Microsoft Flow, then click on Create and select Instant cloud flow.
Now provide the flow name and select the trigger as Manually trigger a Flow.
Step 3: Get items from the SharePoint Online list
Now we will get items from the SharePoint Online list, so click on the Next step and select Get items action. Then provide the site address, list name, and top count as 5, so it will retrieve 5 items from the list.
Step 4: Map the value
In this step we will map the header and value, so click on the Next step and select Select action, then provide the From field the value from the dynamic content, and then map the field value from the dynamic content.
Step 5: Create Html table
Now we will create an Html table, so click on the Next step and select Create Html table action. Now provide the from the field from the output from the dynamic content.
Step 6: Create Html file in the OneDrive Business
Now in this step, we will create a file with HTML extension in OneDrive Business, so click on the Next step and select Create file action. Then provide the folder path, the file name with extension, and provide file content from the dynamic content.
Step 7: Convert HTML file to pdf
Now we will convert the above HTML file to pdf, so click on the Next step and select Convert file action. Then provide the file from the dynamic content and target type to pdf.
Step 8: Create a pdf file in OneDrive Business
Now we will create a pdf file, so click on the Next step and select Create file action then provide the folder path, file name, and file content from the dynamic content.
Once your flow is ready, run the Microsoft flow manually.
Step 9: Run the flow
Now click on Save and run the flow manually, and you can see the pdf file get created in the OneDrive for business. Then provide the folder path, file name, and file content from the dynamic content.
In this Power Automate tutorial, we learned about power automate create pdf from sharepoint list.
You may like the following Power Automate tutorials:
- Microsoft Flow or PowerAutomate: Trigger email based on user input
- Get a push notification when a new file is added to OneDrive for Business
- Save Twitter Tweets in SharePoint Online list using Microsoft Flow
- Get daily weather reports delivered to your email and phone using Power Automate
- Send myself a reminder in 10 minutes in Power Automate
- Microsoft flow parsing select and expand failed get manager v2
- Log Gmail emails to a Google Sheet using Power Automate
- Save tweets to a Google Sheet using Power Automate (Flow)
- Convert Email to PDF using Microsoft flow or Power Automate
- SharePoint custom list example
Please leave your feedback. I hope this article has been helpful for you so bookmark this blog as new articles will be posted regularly. Here, we learned how to convert a SharePoint list item to pdf using Microsoft flow or Power Automate.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).