Microsoft 365 Automation

How Do You Generate Documents from Word Templates Automatically?

Last updated 23 July 2026 · 5 min read

Direct Answer

Documents generate automatically from a Word template using Power Automate's Word Online (Business) connector: the "Populate a Microsoft Word Template" action takes a .docx file built with content controls (labelled fields a flow can find and fill) and merges it with data from a trigger — a Microsoft Forms response, a new SharePoint List item, or an Excel row — producing a finished Word document, which a follow-up action can convert to PDF and route to storage, email, or an e-signature tool. This covers contracts, offer letters, and standard reports built on Microsoft 365, without needing a separate document-generation product for straightforward cases.

Detailed Explanation

A Microsoft 365 business generating the same handful of documents repeatedly — an engagement letter, a standard contract, an offer letter — faces the same manual-copy-paste problem as any business: opening the last version, renaming it, hunting for every field that needs updating, hoping nothing was missed. Power Automate's Word Online (Business) connector replaces that with a flow that fills a Word template from a data source automatically, using tools already inside Microsoft 365.

A typical setup has three parts:

  1. Template — a Word document (.docx, stored in OneDrive or SharePoint) built with content controls: named fields inserted through Word's Developer tab, each mapped to a specific piece of data (a client name, a date, an amount) rather than typed as free-text placeholders.
  2. Data source — the values that fill the template, most often a Microsoft Forms response, a new SharePoint List item, or an Excel row, arriving through whatever trigger starts the flow.
  3. Generation and handoff — the "Populate a Microsoft Word Template" action fills every content control from the flow's data, producing a finished Word document; a "Convert Word Document to PDF" action commonly follows, and the result is saved, emailed, or routed to an e-signature tool if it needs a signature.

This is a distinct capability from processing documents that already exist. What can you automate with Power Automate covers this and many other Microsoft 365 automation tasks generally; this page focuses specifically on the document-generation use case, which is one of the more common reasons a business builds its first document-related flow.

Setting It Up

1. Start with your highest-volume, most standardised document. A document you produce often, with limited genuine variation between instances, gives the fastest and safest first result — a one-off, heavily bespoke document is a poor first candidate.

2. Build the template with content controls, not typed placeholders. In Word, enable the Developer tab, insert a Plain Text, Rich Text, or Picture content control for each variable field, and give each one a clear, unique name — this is what the Power Automate action actually reads, and it's the single most common point of confusion for anyone trying this the first time.

3. Choose a trigger that matches how the document request actually arrives. A Microsoft Forms submission suits a request-driven document (an internal request form that should produce a letter or contract); a SharePoint List item change suits a status-driven document (a deal marked "won" in a tracking list); an Excel row addition suits a batch or reporting scenario.

4. Map every content control explicitly before testing. The "Populate a Microsoft Word Template" action lists each content control by name once it reads the template file — map each one to the corresponding flow data, and don't leave any unmapped, since an unmapped field is a common cause of a document that generates but looks visibly wrong.

5. Add the PDF conversion and delivery steps to close the loop. Generating a Word document and stopping there still leaves someone to manually convert and send it — chain "Convert Word Document to PDF" and a delivery action (email, save to a specific SharePoint library, or send to an e-signature connector) in the same flow so the whole path runs unattended.

Things to Consider

  • Template accuracy matters more here than almost anywhere else in automation. A wrong or outdated template gets reproduced correctly, at speed, every single time — review a new or changed template carefully before it goes live.
  • This is the Microsoft 365 counterpart to a broader capability. See how do you automatically generate documents from templates and data for the general pattern and for use cases like proposals, onboarding letters, and standard reports that apply just as much on Microsoft 365, and how do you generate documents from Google Docs templates for the equivalent workflow on Google Workspace.
  • Version control on templates prevents silent drift. If a template is edited without a clear record of what changed and why, older generated documents and newer ones can quietly diverge in ways nobody notices until someone compares two side by side.
  • This overlaps with, but is distinct from, general OneDrive and SharePoint document workflows. See how do you automate document workflows in OneDrive and SharePoint for organising, versioning, and approving documents that already exist, as opposed to generating new ones from a template.
  • Not every document benefits from automation. A one-off, heavily negotiated contract with unique terms is a poor fit for template-based generation — reserve this for genuinely repeatable documents where the variation is limited to defined fields.

Common Mistakes

  • Typing bracketed placeholders instead of using content controls. The "Populate a Microsoft Word Template" action reads Word content controls specifically — a template built with plain typed placeholder text won't populate correctly no matter how consistent the formatting looks.
  • Publishing a template with an error and not catching it until it's been used many times. Because the whole point is scale, a template mistake also scales — test a new template against a few edge cases before connecting it to a live trigger.
  • No approval step for legally significant documents. Automating contract or letter generation without a review process for the underlying template content risks generating legally binding documents nobody with the right authority actually checked.
  • Ignoring version history on templates. A template changed without tracking what changed makes it hard to explain why two generated documents from different dates look different, which matters if a dispute or audit ever asks.
  • Automating generation but not the handoff. Generating a document automatically and then leaving someone to manually find it, convert it, and send it for signature keeps most of the manual effort in place — automate the full path to delivery or signature where the process allows it.

Frequently Asked Questions

Do you need Word content controls, or will plain placeholder text work?
The "Populate a Microsoft Word Template" action reads content controls specifically — fields inserted through Word's Developer tab (Plain Text, Rich Text, or Picture content controls, each given a matching name) — not arbitrary placeholder text like {{client_name}}. Building the template with content controls from the start avoids a common early mistake of typing bracketed placeholders that the action simply won't recognise.
Can the same flow produce a PDF instead of a Word document?
Yes — pair "Populate a Microsoft Word Template" with the "Convert Word Document to PDF" action (also part of the Word Online Business connector) immediately afterward. Most business use cases (contracts, letters, reports someone will read or sign rather than edit) generate the Word file only as an intermediate step and deliver the PDF.
What data sources can feed the template besides Microsoft Forms?
Any Power Automate trigger can supply the data — a new or modified SharePoint List item, a row added to an Excel table, a Dataverse record, or a Forms response are the most common for this audience. The template-population action itself doesn't care where the data came from, only that the flow maps each content control to a value before calling it.

References

Related Questions