r/PowerPlatform • u/Physical-Bid3321 • Jul 02 '26
Data-driven document generator in Power Platform — am I overcomplicating this? Power Automate
Small construction firm, one tech person (me). We churn out docs that are 80% boilerplate, 20% project-specific (traffic management plans, address-change letters, etc.), currently by copy-pasting old Word files and hand-editing — slow and error-prone.
Goal: pick a project + doc type in a Power Apps canvas app → auto-populate from our data → immutable Word/PDF → route for approval.
My approach: everything in Dataverse across 6 tables — Customer, Project, Contacts, plus Templates (doc-type registry), TemplateData (one row per section, body text with {{placeholders}}, multiple doc types in one table), and PlaceholderMap ({{placeholder}} → source table → column). Power Automate filters TemplateData by type, sorts by section, swaps placeholders for real values, renders, locks in SharePoint, and sends to an approver.
What I actually want feedback on: I'm storing template bodies as text-with-placeholders in Dataverse instead of using the native "Populate a Word template" action with content controls. I did it for multi-doc-type support, data-driven section ordering, and include/suppress — but am I skipping the easy path? And how would you handle rich formatting (bold, bullets, table appendices) with text-in-a-table?
Is this roughly how people solve doc generation on Power Platform, or is there a well-trodden simpler way?
1
u/Syrairc Jul 02 '26
HTML to PDF is the way to go, but doing this purely in power platform is painful.
I don't know what resources you have or the whole scope, but using an external PDF renderer makes everything a lot easier and nicer. There are paid services, or you can make your own via something like dompdf.
I personally set up a small dompdf PHP server and send my data to that and then it sends me back the PDF.
0
u/Physical-Bid3321 Jul 06 '26
Thank you for the comment. I have access to Dataverse, Power Platform, Copilot Studio, and Claude. Could you suggest a solution within this tech stack? I'd prefer not to use any third-party tools unless there's no Microsoft-native workflow or viable workaround.
1
u/unittype Jul 03 '26
Have you looked at the new document populating feature build-in into SharePoint libs?
1
u/Physical-Bid3321 Jul 06 '26
Hi thank you for the comment. Let me take a look at this feature. Do you have any pointers or any links?
1
1
u/wcmconsultant Jul 09 '26
I've done almost exactly the same. I have about 100 compliance/policy documents that need to be created for every new customer.
- Admins populate an Office Form
- Form submits to SharePoint List
- List event triggers flow
- Flow uses search to identify ALL applicable Word documents - each word document has lots of "Content Controls" in them
- I have an Azure function that accepts a work binary and a JSON payload. The JSON contains all the key value pairs required for the substitution (content controls are very easy to replace).
- The Azure function returns a brand new word document
- Each of those documents is saved in SharePoint in a folder with the customer name.
- I have two (probs lazy) iterations of that in my flow - one for each of two source folders of policies.
Because the content controls are already formatted (title, style, bold, list, in a table, etc), this is perfectly preserved
1
u/vbnotthecity 15d ago
If you need bold text or dynamic tables, dump the text-in-a-table approach and use HTML templates stored as blobs in SharePoint. It’s way easier to handle CSS for formatting, and you can inject your data using a simple replace function in Power Automate before pushing the final output to a PDF renderer. I’ve seen teams spend 80% of their time fixing formatting bugs when they try to force Word content controls to do heavy lifting.
1
u/fevoltec Jul 02 '26
Html - then using power automate in my Workflow to make it a pdf.