cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JMAFO
Level: Powered On

Create PDF Invoice from PowerApps

Hello all,

 

I have created a PowerApp that stores invoice information into a SharePoint List. Information like client name, billing info, and invoice items are collected on the PowerApp via the SharePoint list submission form. When the user submits, a flow is triggered that grabs an HTML file from my OneDrive and then the flow uses the replace( ) function to replace specific portions of the HTML with data from the SharePoint list. 

 

This works fine but I find it extremely difficult to format the PDF the way I want it to be, also I can't seem to figure out the logic to only allow a limited number of invoice items on each page and not allow invoice items to "spill over" and ruin the formatting of the following pages. The goal is to have the same format for each page, which would look like this:

 

| Company Logo | Billing Information Here |

|-------- Client Information Here - - - - - -   |

|    ----      INVOICE ITEMS  ----------------  |

|    ----      INVOICE ITEMS  ----------------  |

|    ----      INVOICE ITEMS  ----------------  |

|    ----      INVOICE ITEMS  ----------------  |

|      PAGE TOTAL FOR INVOICE ITEMS  ---  |

 

Each page would be required to look exactly like this. So if there were enough items for 10 pages, each page would be displayed like this. Any help is greatly appreciated.

3 REPLIES 3
Dual Super User
Dual Super User

Re: Create PDF Invoice from PowerApps

Hey @JMAFO 

 

You can also try using word templates for this (it is a premium connector). You can define all the place holder tags and then add repeating control to the word template for each item and you can customize it as needed. 

 

You can check my blog here to get started with that: https://www.bythedevs.com/post/how-to-populate-a-word-template-with-repeating-control

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

JMAFO
Level: Powered On

Re: Create PDF Invoice from PowerApps

Thank you, this was helpful. For premium connectors, would all users in my company be required to have it? Or since the Flows run from my account would only I need to have it? 

Super User
Super User

Re: Create PDF Invoice from PowerApps

@Hey @JMAFO 

Ref Licensing: Whilst I have a view I'd recommend reviewing the licensing document directly... licensing is changing and its worth spending the time to digest the document considering the licenses you hold. (Though, my view is... each user benefiting from the Flow should be licensed... others please correct / add where required :))

Ref HTML Conversion to PDF conversion;

Are you able to share an example of the HTML which is causing issues when spanning multiple pages? You may be suffering from limitations in the OneDrive HTML to PDF conversion... it doesn't provide full HTML support.

This may / may not help... and a disclaimer I work for Encodian who provide the Encodian connector which provides the 'Convert HTML to PDF' and 'Convert HTML to Word' actions.

The 'Convert to HTML' action contains some advanced settings which govern what to do when table data is split across multiple pages, for example 'Repeat Table Header' and 'Repeat Table Footer'... these may help.

Ref HTML Creation with repeating sections;

Many of our customers use the following approach which would also work for the Microsoft OneDrive and Word PDF conversion actions:

  1. Create a string variable
  2. Append the initial part of the HTML document
  3. For an array of items; loop through and append the HTML to the string variable
  4. Append the end part of the HTML document

This image shows shows an example of steps 3 & 4... where a HTML file containing document approval response is compiled and then inserted into an existing PDF document.

 

1.png

 

You can then of course just interlace the HTML with dynamic data from PowerApps, SharePoint, etc. and convert to PDF:

 

2.png

HTH

 

Jay

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (2,855)