Create a PDF from a SharePoint List Item with Power Automate

Do you need to create a PDF file using data from a SharePoint List? In this video I demonstrate how to create a PDF file with Power Automate in less than 5 minutes. This is great for all sorts of things, from generating a certificates for completing a course, receipts from a business process and much more.

To create this workflow I started with a “For the Selected Item” trigger, allowing the Flow to be run manual on the selected SharePoint List item.

The Get Item action is used to get all of the values from the selected List Item.

Use a Compose or Create HTML Table action to define your template using HTML

Next use the Create a File using OneDrive, convert the file to PDF and then generate the PDF and save it to OneDrive. The initial Create File action uses the Outputs from the HTML template.

In my example I have created a folder in OneDrive call DEMO where I save the HTML template and final PDF file.

That’s it! Now you have a Flow that generates a PDF file from a List Item.

One thing to note is the Flow saves the files into the OneDrive of the person who publised the Flow. If you are storing sensitive information you should consider using a service account and moving the files to a secure location.

16 thoughts on “Create a PDF from a SharePoint List Item with Power Automate

  1. This is so helpful, thank you! For my last step, I used the SharePoint Create file action to put the PDF into a SharePoint folder connected to a Team.

  2. Steve – Very helpful. Thank you. Some of my data does & some doesn’t come across from my list. The data that isn’t coming across seems to be large blocks of data as opposed to short descriptions. Not even making it to the HTML file. Any ideas. I’m getting ready to research but figured I’d ask.

    1. Hi Ken, it could be due to special characters in the multi-line text field. Try making that field a Plan Text format rather than Rich Text. Another possible cause could be quotes that may break the HTML generated.

  3. Hello again, I was wondering if you’ve done any videos that might help me with my current challenge?
    I’ve been able to get most of what I need from this video, but my SharePoint list has a Nintex form that includes a repeating table. I have connected that repeating table to a multiple lines of text column in my SharePoint list. I have an inkling that it’s a xml something, but as a self-taught user, I don’t fully understand what that is.
    I want that repeating table to be added into the middle of the PDF, but I don’t know how to achieve that.

    1. Hi Sandra, have you tried creating an HTML table in the muliple line text field? You can insert additonal HTML inside the HTML template I use in my example (just the table elements e.g no header tags).

  4. Steve,

    Thank you for the helpful video. When I try to use the html table function instead of compose, I receive the following error message: The ‘from’ property value in the ‘table’ action inputs is of type ‘Integer’. The value must be of type ‘Array’.

    I am using “ID” as the input.

    1. Hi William, do you mean you are using ID in the HTML template? e.g. a mix of HTML plus the “ID” value from a List item?

  5. Thank you so much for this, it’s exactly the answer I was looking for. However I’m having an issue with dynamic content that contains more than one response.

    I’m using this to create a pdf document based on an entry in a SharePoint list. The responses are for an incident report that it is completed through a Power Apps form.

    Some of the responses allow for multiple answers. I have a text field for a list of witnesses, separated by commas, as well as a list of injury types and locations where the staff member can select all that apply to them.

    How can I get the items in these fields separated into bullet points?

    I can bullet the line, but not separate the contents to provide multiple bullets.

    Also, for the fields where more than one option can be selected, I’m not getting the responses at all, more of an error code.

    [{“@odata.type”:”#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”,”Id”:10,”Value”:”Sprain/strain”},{“@odata.type”:”#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”,”Id”:13,”Value”:”Other”},{“@odata.type”:”#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”,”Id”:-1,”Value”:”possiblybroken- awaiting xray”}]

    Any help would be greatly appreciated, I’m incredibly new to this and it’s my first journey into the world of HTML code.

  6. Steve, this is great. However, one of the fields I want to pull is a people picker, where I allow multiple people to be added to that field. How can I pull the details for the display name for each and add that in the table? I know this is kind of goofy with Sharepoint people picker fields, any help would be appreciated. Also how can I add grid lines to the table?

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 )

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