Introduction
Recently, we had requirement from a client, wherein we had to create quarterly invoices using various data from SharePoint lists (as PDF file) and send it to client after approval from multiple parties. The invoice had to have
- Detailed data in tabular format to include the figures from each month.
- Header & Footer
- Footer should have page numbers.
The expected format of invoice is something like below. I have masked the header/footer logo, client name address etc that is PII.
One thing was sure, we could not use the HTML to PDF conversion as described here. Because adding page number, Header/Footer is not possible with HTML.

In this article, I will show you the process for creating sample invoice step by step. How we achieved this and the output at the end of the process.
Step-by-Step Process
- First of all, we will start with creation of Word Template using word desktop.
- We will need to use Developer menu. To show Developer menu in word, refer to the screen shot below.
- Now we will prepare the word template having content for invoice. Let’s start with inserting the container for the client name.
- Add the other details of invoice (wording) and for adding monthly invoice lines in tabular format, add a table like below. In this example we will have only two columns.
- we will now prepare the table further for inserting dynamic data from power automate.
- Insert repeating content control. This helps in creating multiple rows with dynamic data from power automate.
- Select the repeater control using the 3 dots at the left of the control and provide name of the repeater control like below
Save this template on SharePoint.
- We will need to use Developer menu. To show Developer menu in word, refer to the screen shot below.
- Create Power Automate flow.
I have created instant flow that I will manually trigger for showing sample invocation. However, the real life flow gets triggered from Power Apps by user.- Add a variable for storing Client Name
- Add a variable for storing the invoice records (later to be used for populating the table in invoice)
- Set the client name. You can pick the client name from SharePoint list.
- Add the invoice details for each month to the array variable. Here as well, you can get the invoice details from SharePoint list and append in a loop.
- I have added sample data like below.
- Now we have both template and data ready, we will now populate a word template using connector below
- Select the template from SharePoint location, set the Client Name from the variable ClientName and for the repeater control, click on control below.
- for table records/repeating data, select the array variable like below
- Create a word document using the content of the step above.
- if you need to create a pdf you can go ahead with steps below, otherwise you can use the document file created in above step and use it to send email or teams message any other actions to distribute the invoice.
- The pdf content is ready, those can be saved at a physical location with below or distributed across email/teams.
- Add a variable for storing Client Name
Output :
Here is the word document created

Here is the pdf created. You can further modify the template to adjust the font style, size etc.

Do let me know, if you found this article helpful or not. Also provide your comments on how it can be improved.