In this article, i will explain how to convert SharePoint List items into PDF using default Microsoft provided Actions.
So lets get it going, You can Either use a Scheduled Flow or Instant Flow to start as a trigger.For my demo, i will be using Instant Flow that i can manually trigger.
So the first action is to Initialize a variable after a trigger, that can act as our starting HTML. My code looks like this
<style>table, th, td {
border: 1px solid black;
}</style>
<table>
<tr>
<th>Title</th>
<th>Date</th>
</tr>

You can enter as much as HTML content you like so you can actually format your document. Here you can see that for the demo i am only demonstrating only two fields from my sharepoint list i.e. Date and Title.
Next step is to get the sharepoint list items. If you would like you can pass on the filter query.

In my next action, i will use a Apply to each action so i can list down all the items and format them in a table. Note that i am also appending my items to my initial variable that i defined in the start so i can get a HTML table completed

After the apply to each i will just append more to my variable so i can close the table.

Once that is completed, i will generate a HTML file using Create a File action. After creating the HTML file i will convert it into PDF and finally i will create another File of type PDF. The sequence of these actions is important and you should reference the output of one action in other action for smooth flow. I am using the utcNow() function in the name of the file so that i get a unique name of file .

With all the steps completed, now i will test the flow and it will generate two files in my Onedrive.
So in this way you can convert SharePoint list into PDF using Microsoft Default Actions without the need of 3rd party actions.
Comments