Power Automate & Quick Parts

What does that title mean? Translation: Create a Microsoft Flow that will let people fill out a form and place the field values in specific spots of a Word document, so that it looks like a filled-out legal document (or any kind of document). Quick parts are not new. They’ve been around since SharePoint / Office 2010. This post is really just showing a way that they can be used in conjunction with Flow.
- Create a document library in SharePoint, and add new columns in the library, for each piece of information that you’d like to insert into your documents. In my example, I’m adding these text columns: Customer, Hours, TaxID
- Create a new Word document in that library, or if you already have an existing document to use as a template, upload it to your new library. Mine will be “SOW Library”.
- Once your document is in the library, then open it in MS Word. (NOT Word Online)
- In Word, go to the Insert tab. Click Quick Parts, and choose Document Property. From the list of document properties, you’ll see your library’s metadata. Click a property to insert it in your document.
- Go through the process of putting your cursor in your document in each spot that the value belongs, and insert Quick Parts wherever you need them. Here is an example. Note that my font here is red, but is typically gray by default.
- Save your file in place, and close Word. My file is called SOWtemplate.docx
- Go to Microsoft Flow. flow.microsoft.com, and create a new, blank Flow.
- Your trigger can be whatever you’d like it to be, but for this simple example, I’ll use a manual trigger, a button. In your manual trigger, create input parameters for each of the values you’re using in the document as quick parts.
Again, this is a simple example. Your Flow could be getting this information from a SharePoint list form, from Salesforce, or PowerApps. The objective of this post is to show you how data coming from *wherever* can be automatically inserted into a new Word doc. - After the trigger, your first action will be a SharePoint action called Get File Content. Remember that file you created at step 1? That is the file that you want to get.
- Add a SharePoint action to Create File. I just create mine right there in the same library, but of course, you could put it in a different library. For the File Name, I’m using the Customer from the manual input parameters. The File Content here is from the Get file content action.
- Add a SharePoint action to Update file properties. For the ID, I picked the ItemID from Create File. For the Customer, Hours, and TaxID, I used the 3 input parameters respectively. For the file’s Title, I went ahead and used the Customer parameter there as well. This step puts the metadata on that new file you created. Those other fields, I blurred out because they are irrelevant to this demo. At this point, you can save your flow, run it, and go to the library and see the new file there.
The deal with Quick Parts, unfortunately, is that they’re a little weird when using Word Online. The file looks fine when you open it up in the Word client software (on your computer), but in Word Online, the values don’t show in the Quick Parts. Here’s the trick. When people have read-only access to the file, the Quick Parts show correctly in Word Online, or when you preview the file. Also, when you send it in an email it looks fine. Here’s how to preview:
Then here’s what the file looks like:
- For this example statement of work, I want to email it out to the customer, so here’s how to add a couple more actions to the flow, to automatically email that new file. Add another SharePoint action, Get file content. Rename it to Get file content new file. For the File Identifier, use the ID from Create file.
- After that, add the Outlook action called Send an email (V2) (preview). To keep this one simple, I’m just sending the email to whomever manually triggered the Flow. In the subject, I mention the name of the customer (from my input parameters).
For the attachment name, use File name with extension, from the Update file properties section. For the File Content, get that from the Get file content new file section.
Side note: Another idea, is that you could add another (text) input parameter in step 1 called Customer Email. That way, this Flow could automatically send this to your customer. Don’t use the input parameter type called Email though, because it only allows input of people inside your organization. Use just a text one in order to type an email address of someone external.
Here are some more details from that attachments section…
And here is a screenshot of the whole thing:
Have fun Microsoft Flow’ing!
Here are a couple of references of much older posts that I’ve written in relation to Quick Parts:
Great post. Could this be done using a custom list instead of a document library? I have a similar need but all my information is contained in a sharepoint custom list.
LikeLike
To spit out a document, though… you’d at least need to have a document library to use as a staging area, and the library would need to have all the same metadata as the list. Flow can even add the document as an attachment to your SP list item at the end, there’s an action for that.
LikeLike
Great Post! thank you for the information!
I am facing a similar problem, I would like the trigger be “When an item is created” from a SP List and use this information to be filled in the Word Template document storage in the Library, however it has not worked well for me.
I would like that every time I add an item in the SP List, this creates a Word document filled with this information, then send an email (as explain in your steps 🙂 ) and add the document as an attachment in the SP List.
When opening the word document on my desktop with the word application from SP or when opening the attachment sent by email, it does not send the correct document – it sends the template with the tags not replaced.
I am using drop down value and person value (I have a column name Employee and the value is Person) in some of my columns.
Is something else I am missing?
I will truly appreciate any suggestion,
Thanks,
Veronica
LikeLike
Excelent post! I’m developing a solution using quick parts, however when i try to save this document as PDF from Microsoft Flow using Plumsail it does not show the quick part data, only the tags 😦 Do you know any solution? Thanks in advace
LikeLike
Thanks for this post. It came at the right moment. I have was looking for a solution with the same problem. I followed your instruction but when I send the e-mail the attachment still shows only the template and not the values. The Word document has all the values in it.
LikeLike
The user you are sending the word document must have at lest read access to the document library or list where the values are saved. If is an external user, you could convert it to PDF (Muhimbi works for me) before send it.
Regards,
Carlos
LikeLike
Thank you for this post! Are these quick parts also restricted to 255 characters only? Is there any way to copy data from a SharePoint column to the Word template if the data string is longer than 255 characters? I haven’t found a way to build the document using bookmarks and form fields only hold 255 max. Thank you in advance!
LikeLike
I think it may be limited, but I haven’t tried doing that.
LikeLike
Hello
eleanor,
I have the same problem, have you found a solution?
Stephane
LikeLike
This is great! I was able sort of get this working with a list. However the resulting entry in the Doc Library has a blank icon (so it doesn’t appear to be any kind of file type). And it won’t open as a file. What do you think I’m doing wrong?
LikeLike
I figured out that I had forgotten to add the .docx at the end of the file name! Geesh!
LikeLike
This is awesome. Thank you! I have been able to get this to work with a list item creating the new file in a doc library. I have even been able to configure a doc library column as multiple lines of text with enhanced rich text (for bullet points). Unfortunately, my data is showing up with html tags in the quick part within the word doc. Is there any out of the box way to fix this?
LikeLike
I have triggered this in PowerApps. I am getting a Flow failure “Action ‘Get file content’ failed”.
Error Details “The response is not in a JSON format”. Also when I open the template in Word Online, I cannot see any of the merge fields (I put a couple of test items in the template Library item record). I normally do these merges in MS Access directly from the SharePoint list, however your solution will be far better and more immediate if I can get it working.
LikeLike
The template isn’t going to work in Word Online, but for this solution it doesn’t matter. Did you try this solution with a manual trigger instead of from PowerApps, like in the steps? I don’t know what kind of data is being sent from your PowerApp.
LikeLike
Thanks for this. Very Informative post. However I have 2 questions
1. Can we do the same with an Excel File?
2. We like to use this for a Purchase Requisition. Where the PR Number and Date will be same however we may have 3 or 4 line items. How do we get all the line items to show as a table on the Word/Excel Document
LikeLike
1. No.
2. You can’t with quick parts.
LikeLike
Hi, after creating the file and update the file properties, I can only update document Title and have no other fields. Do you know why? Thank you.
LikeLike
I’m having the same issue as Geir André, only document Title can be modified, and in my case I can also modify the document library’s required columns, but that should happen regardless of what file I’m working with.
LikeLike
As long as you’ve created the metadata columns, from then on when you create a file directly in the library, then the fields should be there. I’m not sure how that could go wrong. Try different permutations of ways that you’re creating the file?
LikeLike
Ok so the way I solved it was creating a new Document Type (with the hassle that entails), create a new Word document with that document type, populate fields inside the document and map them to the fields that are part of the document type.
It’s one of these typical convoluted SharePoint steps but I guess it makes some sense. Works like a charm now 🙂
LikeLike
Great posting Laura. Was wondering whether I could insert list of item using this method? like a list of items procured or something in that nature
LikeLike
No.
LikeLike
I have created a SharePoint list with a flow attached to create a word document based on a template using the Document Property Quick Parts. Everything is working fine except if there has been no text entered into a field. The Word document shows the Quick Part Tags which I would like to be blank if no data is entered.
LikeLike
This is exactly what I wanted. Worked like a charm. You’re the best. Thank you!
LikeLike
You are the best!! These instructions, screenshots everything is awesome. Thanks a ton. I have been searching for this since months and found it today and id it in 3 hours. Thanks very much. Great job.
LikeLike
Love this. One question, do the templates have to be on the same library as the docs you are saving into?
LikeLike
Thanks for the info! I currently have a SharePoint list where I need to create a word doc based on the selected list item. I’ve followed your steps, but I am getting the error “One or more field types are not installed properly”. Have you come across this before? I’m curious if I am getting this error message because I am using date, person, number, and choice content types.
LikeLike
looks like using a rich-text metadata column type remains an open issue. any updates from folks that have that working?
LikeLike
has anyone found a way to support the rich-text metadata column type?
LikeLike
I’ve created a flow that starts with a form, the data goes into a list, and the list should be populating my Word doc. The flows run smoothly and without error; however, the doc never actually populates. It creates a new document in the library, but it’s an unassigned file format. Once I select for the file to be opened in Word, it opens a document identical to the template–without any of the unique QuickParts info.
Any idea why that could be happening?
LikeLike
I recommend trying to isolate the issue by directly populating the library columns via a flow, without involving your list. See if that works, and you’ll know which direction to troubleshoot. Try populating columns on a specific file that’s already in the library, then try making it create the new file and then update the properties, so you can see where it’s going wrong.
LikeLike
Thank you for this amazing infos! I am struggeling with the quick party from word. Is there also a way to insert the word document version?
I tried several options to insert the version, but i could not find any way. I also tired it with the label function inside the “Information management policies settings”. Do you know any way to insert the document version just like all the other metadata?
LikeLike
That’s a great question! I don’t know the answer, though, I’ve never tried it.
LikeLike
Thank you for the fast response.
Would you mind if you give it a try? We are very desperate about this problem and it is such a urgent problem for us.. 😦
Also would be a nice post for this site in future 😉
LikeLike
I don’t have time this week, but I’m sure I’d be trying all the same stuff you already tried.
LikeLike
Thanks so much for your instructions on how to create a Word document from a sharepoint list item. The power of your brain amazes me.
I’ve been using your page as a reference now for a while. e.g. for my school’s sporting program, coaches fill in a match report form that creates a nicely formatted Word Document that is emailed to the Heads of Sport. Lovely.
Someone today tried to copy the reports from the Sharepoint Library where they were created to another Sharepoint Library. The result was blank templates (none of the content copied across).
If I copy them to my desktop no problems. If I copy them to another SP library, empty documents.
I am guessing the Documents are dynamic and do not see any data in the new Sharepoint Library and are therefore empty.
Wondering if you know of a way to ‘finish off’ the new Word Documents so they become stand-alone? I could convert to PDF but they occasionally need to be edited.
Regards
Scott
LikeLike
Converting them to PDF would be a good way. There’s also a new action in flow “word template” that’s a premium connector. https://flow.microsoft.com/en-us/blog/intermediate-flow-of-the-week-create-pdf-invoices-using-word-templates-with-microsoft-flow/
Using this instead of quick parts would be a good solution, except it’s not free.
LikeLike
Thanks! I just looked and found ‘populate a word template’. I’ll have a play with that later. Might be less messy.
LikeLike
Thanks for that hint about Word Template.

It works really well.
The created documents are stand-alone and do not appear empty if moved to a different Sharepoint site.
I can now have our sport coaches fill in a Sharepoint Form on their Sharepoint Phone App, have it create the report, email it to the Heads of Sport and copy to other Sharepoint sites depending on sport. So happy.
LikeLike
Caveat on the use of Word Templates.
While they are stand-alone Word Documents, each file created remains a template file and the data in each field in uneditable. I’ve had to abandon the use of Word Documents completely. I’ll try PDFs as they can edit them using Acrobat.
LikeLike
Awesome article, but have gone over everything multiple times, and still will not update the quick part fields. Everything else works, and creates files in the docs library, and puts all the correct information in the column fields of the docs library for each file created, but will not update the information in the word doc quick parts. It does however name each new file correctly. Any thoughts on possible avenues to start looking? Have redone everything about 3 times now, in case I made some silly typo error, but cannot get the flow to write into the quick part areas at all.
LikeLike
Nope, all good, umpteenth time lucky, but not sure why, must have been a typo somewhere. Thanks 🙂
LikeLike
Hey Laura
good post but have you tried updating a date field?
All the fields except date are ok but if i use date field i get some strange dates entered into word template. It seems like word and powerautomate in this case work with different time zones or something similar. Can you try to achieve this?
LikeLike