Skip to content
Browse guides

Choosing a way to generate documents

Compare six ways to turn SharePoint or Power Apps data into Word and PDF files: where each starts, what it produces, which connectors and licenses it needs, and which tutorial builds it.

On this page
  1. Overview
  2. Three questions to start with
  3. The approaches side by side
  4. Choosing between them
  5. Licensing
  6. What the Word Online (Business) approaches have in common
  7. File names and repeat runs

Microsoft 365 gives you several ways to turn list data or an app record into a Word or PDF file. They differ in where they start, what they produce, and which licenses they need. This guide compares them, so you can pick one and go straight to the tutorial that builds it.

Three questions to start with

  1. Where does the work start? From one item in a SharePoint list, from many items at once, from a Word file already in a library, or from a record in a canvas app.
  2. Is premium licensing available? Most approaches use the Word Online (Business) connector, which is a premium connector. The standard-connector approach avoids it, and so does the one-page PDF option in a canvas app.
  3. Does the output fit on one page? In a canvas app, a one-page document can be made without a flow.

The approaches side by side

You want toStarts fromProducesConnectorsTutorial
Make a Word file and a PDF from one list itemFor a selected item in a SharePoint listWord and PDF, saved in a librarySharePoint, and Word Online (Business), premiumCreate Word and PDF documents from a SharePoint list item
Make files for every item someone has markedA Yes/No column marking the items, then one runWord and PDF for each marked itemSharePoint, and Word Online (Business), premiumBatch generate Word and PDF documents from a SharePoint list
Start that batch run from a button on a pageA canvas app button placed on a SharePoint pageThe same files as the batch runSharePoint, and Word Online (Business), premiumProcess marked SharePoint items from one Power Apps button on a page
Make a PDF without premium connectorsFor a selected item in a SharePoint listA PDF from a Word template saved as HTMLSharePoint and OneDrive for Business, standardGenerate a PDF from a SharePoint list item with no premium connectors
Convert a Word file that already existsFor a selected file, from a button in a document libraryA PDF, saved in a folder you chooseSharePoint, and Word Online (Business), premiumConvert Word files to PDF from a SharePoint library button
Turn a canvas app record into a documentA button in a canvas appA one-page PDF made in the app, or Word and PDF files from a flow that emails one of themNo flow or Word connector for the one-page PDF. For the flow: SharePoint, Office 365 Outlook, and Word Online (Business), premiumExport a Power Apps form to Word or PDF and email it

Choosing between them

One item, with premium licensing. Start with the single-item tutorial. The batch tutorial and the canvas app export tutorial link back to its steps for building the Word template.

Many items at once. Use the batch tutorial when people mark rows and one run should handle them all, up to the limit the tutorial sets for each run. The marks are shared, so a run processes every marked row, whoever marked it. Add the button tutorial if people should start that run from a page, not from the list’s menu.

No premium licensing. The standard-connector approach fills an HTML version of your Word template and lets OneDrive convert it. The Word file’s look carries over, but some Word features don’t survive saving as HTML, so the tutorial adds the logo and title back.

The Word file already exists. If someone has already written the document and only needs a PDF, the conversion tutorial adds a button to the library that converts the selected file. It doesn’t fill in a template.

The data is in a canvas app. If the record fits on one page, the Power Fx PDF function makes the file in the app, without a flow. It’s an experimental feature, and Microsoft says experimental features aren’t meant for production use. For longer documents, the same tutorial’s second option sends the record’s ID to a flow that fills a Word template and emails the result.

Licensing

Word Online (Business) is a premium connector in Power Automate and in Power Apps. Who needs a license depends on how the flow starts, not on whose connection it uses: connections are independent from license checks.

These are Microsoft’s general rules, not an answer for your organization. What anyone needs depends on the whole scenario: the connectors, how the flow starts, any app it serves, the licenses people already have, and who gets value from it. Check the Power Automate licensing FAQ against your own setup before you choose a trigger.

The standard-connector approach uses only standard connectors.

What the Word Online (Business) approaches have in common

These apply to the approaches that use the Word Online (Business) connector. The first three apply where a flow fills a Word template. Each tutorial explains them where they apply.

  • Build the template in Word desktop on Windows. The Word Online (Business) connector page says template creation in Word for Mac isn’t supported.
  • Check which content controls you use. The same page lists the ones the template action doesn’t support: rich text, building block gallery, date picker, check box and legacy form controls. It also says control names in a template have to be unique, and that line breaks are rendered when a control has Allow carriage returns (multiple paragraphs) turned on.
  • Check sign-in policies. The connector page says the Populate a Microsoft Word template action can’t be used if a multifactor authentication (MFA) conditional access policy is enabled.
  • Allow a moment before using a new file. The connector page recommends a small delay, about a minute, before a follow-up action uses a file the connector created.
  • Check sensitivity labels. According to the connector page, Convert Word Document to PDF doesn’t support files labeled Confidential or Highly Confidential.

File names and repeat runs

This applies to every approach. A second run for the same item, or two runs at once, can reach a file name that’s already taken. The tutorials use three kinds of name:

  • Current documents keep a name that never changes. The list and app tutorials use the item’s ID, such as Request-42.docx and Request-42.pdf, and show the title inside the document. Each run replaces them. A name built from the title doesn’t stay with the item: after someone edits the title, the next run makes a new file, and the old one stays.
  • Working files go in a folder named after the run, or carry the run’s name. The expression workflow()?['run']?['name'] returns the name of the current run, which is different for every run. To keep one current copy, the finished files are then moved into place with Replace, which leaves the run’s folder empty.
  • History copies need a name no other run can have. See Keeping a history below.

One run per item at a time. Each tutorial is meant for one generation of an item’s documents at a time, however it’s started and whoever starts it. None of them enforces that. Run folders stop two runs from sharing a working file, but not from replacing the same final files. Each final file shows the run that last replaced it, and the Word file and the PDF are replaced by separate actions. So:

  • When two runs for the same item overlap, the Word file can come from one run and the PDF from the other, and the item may have changed in between.
  • A run that fails between the two replacements leaves a new Word file beside an older PDF.
  • After a failed run, check both final files. To repair a mismatched pair, wait until no other run for the item is in progress, then run the flow once more. If it succeeds, both files come from it.

Run folders stay in Runs after each run. A failed run keeps its folder, with any working files that weren’t moved out, so you can see how far it got. From time to time, delete old run folders by hand. Before you delete one, make sure no run is in progress, and that the final documents are in place and open correctly.

Keeping a history

Keeping a history is a choice about what builds up over time:

Final file nameWhat you end up with
Request-<ID>One current file per item. Each run replaces it
Request-<ID>-<status>One file per item for each status it has had. A run in the same status replaces that file
Request-<ID>-<date and time>-<run name>A new file for every run, kept until someone deletes it

For a copy of every run, put the run’s name in the file name. A date and time makes the names easier to read, but two runs can start at the same moment, so on its own it can repeat.

Build the name once, so that the Word file and the PDF match:

  1. Before the first Create file, add a Compose named History name. In Inputs, type Request-, select the item’s ID, type -, add the expression below, type -, and add the run-name expression.

    formatDateTime(utcNow(), 'yyyy-MM-dd-HHmmss')
  2. In each Create file, set File Name to the Outputs of History name, followed by .docx or .pdf.

Move file keeps the name, so the copies in the destination have the same names. utcNow() returns the current time in UTC, so the time in the name is UTC. Plan how long to keep anything that builds up.

The conversion tutorial is the exception: its PDF takes the Word file’s name, and the tutorial explains what that means after a rename, and how to keep a copy from every run.

Need help applying this to your own setup? Read about consulting.