Fill Word .docx templates with data from any Windmill script, flow or app, with no Microsoft account needed.
Set up in 3 steps
Set up workspace object storage
The script reads the template from, and writes the result to, the workspace object storage. Configure it once under Workspace settings, Object storage.
Write a template
In Word, put tags where the data goes: {customer} for a value, {#lines} and {/lines} around a block to repeat for each element of a list. Save it as .docx and upload it to object storage.
Run Fill Word template
Pick the template file, pass the data as a JSON object whose keys match the tags, and choose where to write the filled document.
Scripts
Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.
Questions
Do I need a Microsoft account?
No. The document is filled inside the script with the docxtemplater library; nothing is sent to Microsoft.
Can I get a PDF?
Not from this script alone. Upload the filled document with the OneDrive Upload File script, then download it with convert to PDF turned on.
What happens to a tag with no data?
It is replaced with nothing. A list tag with no data removes its block.
Are images or HTML supported?
No. Those need docxtemplater's paid modules. Text, loops and conditions are supported.