Generate a Document from a Form: The New SharePoint Action
Let’s talk about a Power Automate action that’s going to save you (and your end users) a ton of headaches and time. On this week’s Power Hour, we dug into how to generate a document from a form — and specifically, how to do it after an approval process.
Here’s the thing: I’ve built a lot of approval workflows over the years, and the pain point is almost always the same. Someone fills out a request, it goes through approval, and then somebody has to manually create the final document. As a result, you end up with duplicate work and room for human error. Pretty inefficient, right? Fortunately, this new action fixes that.
🎯 The Business Scenario
For this demo, I used a classic example: a travel request. First, an employee fills out a form. Then, it routes for approval. Once approved, the workflow needs to generate a document from a form automatically — a polished Word doc with all the travel details and approval info baked in. So there’s no extra step for the end user, and no separate form to fill out twice.
This builds on a concept I covered in an earlier Power Hour about document generation forms in a SharePoint library. This time, though, we’re connecting that same technology to an approval process using a brand-new flow action.
✅ Note: Before you try this yourself, make sure you have a Microsoft 365 Copilot license. Otherwise, you won’t see the document generation form option in your library at all.
🧩 How the Pieces Fit Together
So how do you actually generate a document from a form once approval is in the mix? Essentially, it comes down to three components working together:
- A SharePoint list with a modern form for the initial request (in my case, a travel request list)
- Approvals enabled on that list, so the request routes for sign-off
- A document generation form set up in a separate document library, which is what the new action actually points to
That third piece is the key. Specifically, the document generation form is where AI scans your Word template, finds fields, and even lets you build in conditional sections — so your final document changes shape depending on the data. For example, an international travel section might only show up if someone checks “international travel,” while a rental car section only appears when needed.
⚙️ Building the Two Flows
Because we’re layering approval on top of document generation, you’ll actually need two flows working in sequence.
Flow 1: Kick off the approval. First, when someone submits the request form, this flow fires a “create an approval request” action and sends it to the designated approver. Since the end user doesn’t have to do anything extra, this part stays simple.
Flow 2: Generate the document. This is where the magic happens. Once the item is modified and the approval status changes to “approved,” this flow uses the new action to generate a document from a form, pulling data straight from the SharePoint list and mapping it into every field in your document generation form.
⚙️ Step-by-Step: Set Up the List
Here’s exactly how to build this, based on what we walked through live.
1. Create your source list
Start with a SharePoint list for the initial request (a travel request list, in this case).
2. Click the Forms button at the top of the list, to create a modern form for it, so end users fill out a clean, form-style interface instead of the out-of-the-box list form. This also means end users don’t need direct access to the list itself.

3. Enable approvals on the list
Go to the Integrate tab on your travel request list and choose Approvals, then enable them. Keep in mind, enabling approvals doesn’t automatically kick anything off — you still need a flow to trigger the approval request itself. Here’s my blog post about the SharePoint approval request action.
⚙️ Step-by-Step: Set up the First Flow
4. Build Flow 1 — trigger the approval
Create a flow and name it Travel approval.
5. Add the new When a form is submitted trigger built specifically for modern form submissions (rather than the generic “when an item is created” trigger).
With this new trigger, you could potentially create multiple different forms on the same list, and different forms could trigger different flows.

6. Add the Create an approval request for an item or file action. Here, you’ll specify:
- The site and list the approval applies to
- The approval type (default/single approver, to start)
- Who the approver is (in a real build, this would typically be dynamic, like the requester’s manager)
Of course, your approvals and multiple levels and dynamic approvers are going to be more complex most likely, but in order to focus on the content and goal of this post, I’m keeping this example very simple.

This is what the approval request looks like when it goes to the approver, in Teams:

⚙️ Step-by-Step: Set up the Library and Template
7. Create your Word template
In a separate document library, upload a Word document. I used the Documents library on my site. This will be what the final produced file looks like. Use simple bracketed placeholders (like [Requester Name] or [Start Date]) for every field you want to be dynamic. Avoid Quick Parts or other legacy field types, since the AI scan is specifically looking for that bracket pattern. In this other post of mine, document generation forms in a SharePoint library, I went through all of the steps.

8. Generate the document generation form
From that library, use the Forms button to create a document generation form and select that template you uploaded in step 7. This walks you through an AI-powered wizard that scans your template, finds every bracketed field, and lets you define conditional sections — so, for example, an international travel section only appears if that box is checked. Here is an example of what my travel document template looks like, as you can see, AI detected everything with [ ] around it as a field.

⚙️ Step-by-Step: Setting Up the Second Flow
9. Build Flow 2 — generate the document after approval
Create a second flow, I named mine Travel after approval.
10. Add the SharePoint trigger when an item or file is modified.

11. Add a condition that checks whether the approval status has changed to approved. The little nuance here is that Approval status label is equal to Approved.
Be sure to pick Approval status label here, not just approval status.

12. If true, add the new SharePoint form: Generate a document from a form action, and point it at your document library and the form you just built. As soon as you pick your form name there, it will take a couple of seconds and you’ll see several advanced parameters show up, but you may need to click the show all button there, to see them. See my fields here are things like the travel request title, requester name, department, etc. Hold off on filling out any numbers or dates, those have to be done a different way.
13. Map your fields
This is the tedious-but-important part: map every field in the generation form to the corresponding data in your SharePoint list item. I’ve got some extra notes below, for some field types that may give you trouble.

Step 8: Test it end-to-end
Submit a test request, approve it, wait about 5 minutes, and confirm the document generates correctly. If you hit errors when the workflow runs (date fields are the most common culprit), troubleshoot one field at a time rather than mapping everything at once — it’s much easier to isolate the problem field that way.
✅ Note: If a field throws a validation error, start by removing calculated fields and date fields first — those are the two field types most likely to cause trouble with this action while it’s in preview.
🐛 A Few Things to Watch For
Since this action is still in preview, I hit a few bumps live on the show — and honestly, that’s half the fun of Power Hour. Meanwhile, here are a couple of lessons worth passing along:
- Calculated fields can be finicky. If a field errors out, try replacing the calculated column with a direct expression instead.
- Date fields need the right format. Because SharePoint dates don’t always play nicely with what this action expects, you may need to reformat them with a compose action first.
For the “Days” which is the calculation between the travel start and travel end, the flow errored when I tried to use the SharePoint calculated column. This is the formula that ended up working:add(div(sub(ticks(triggerBody()?['TravelEndDate']), ticks(triggerBody()?['TravelStartDate'])), 864000000000), 1)
For each of the date fields, I had to use this syntax in an expression. This is the travel end date as an example:
formatDateTime(triggerBody()?['TravelEndDate'], 'MM/dd/yyyy')
The Approval Data is Tricky
Another snag was in trying to insert the approval information. Inherently, an approval could have multiple approvers, so when inserting approval dynamic data, it creates a loop in your flow. My approval in this example is just one approver. To avoid the loop, I created a variable. Right after the flow’s trigger, initialize a string variable, varApprover

Then, in the true condition side of the flow, set the variable to the approvers display name. As soon as you select the dynamic data of the approver’s display name, a for each loop will appear.

Then, in the dynamic data of your action Generate a document from a form, insert that variable in the approver name box:

Convert the Document to PDF
Once you have the Word document output, it will appear as a new file, in the library where you created the document generation form, in my example, my “Documents” library. For a file that is considered final and approved, you may want to then automatically convert it to a PDF. Here are the extra steps to add:
Get file properties – Use the dynamic ID from the Generate a document from a form action.

Get file content – Use the Identifier from the Get file properties action.

OneDrive action – Create file – Use the dynamic File name with extension from the Get file properties action. In this action, this is your opportunity to create a completely different file name other than the default that it has assigned. So, instead of just the File name with extension, you could combine dynamic data such as the requestor’s name and the destination where they’re going, etc.

OneDrive action – Convert file – Use the dynamic file content from the previous Create file action.

Now that the PDF file has been created, what do you want to do with it? This is up to you and your business process. You could add a Send an email action, you could use the SharePoint create file action to create it in a library, etc. Just a note that when I added the action to add this as an attachment to the original travel request, using the add an attachment action, unfortunately it un-approved the travel request because when you use the out of box approvals and then change anything on that original item, it gets un-approved. Also, you may want to add a OneDrive delete file action, to delete that temporary file after it’s been converted and sent.
Here is the final flow, with a bonus action at the end to send the PDF in an email:

💡 Where Else Could You Use This?
This isn’t just about travel requests, though. Think about anything at your company that needs a formal document generated with conditional details: contracts, project charters, onboarding paperwork, vendor agreements. In fact, any process where the final output changes shape based on the data is a great candidate to generate a document from a form this way.
I’d love to have you join us live — Power Hour runs every Wednesday at 11am Central, and you get to vote on next week’s topic.
FAQs
Yes — the document generation form button in your library only appears with a Copilot license active.
No, it’s built for Word documents, which you can then convert to PDF.
Yes, but since you’ll still need the Copilot license.
Ready to build workflows like this yourself?
Check out our Power Automate courses at IW Mentor, and don’t miss the next live topic vote in our newsletter!
So — what business process are you already thinking about automating with this? Let me know in the comments! 👇
Here is the video walkthrough: