74 comments

  • 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.

    • 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.

    • 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

  • 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

  • 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.

    • 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

  • 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!

  • 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?

    • Michael K. Malloy

      I figured out that I had forgotten to add the .docx at the end of the file name! Geesh!

  • Michael K. Malloy

    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?

  • 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.

    • 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.

  • 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

  • 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.

    • Gregory MacGregor

      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.

    • 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?

    • Gregory MacGregor

      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 🙂

  • 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

  • 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.

  • This is exactly what I wanted. Worked like a charm. You’re the best. Thank you!

  • 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.

  • Love this. One question, do the templates have to be on the same library as the docs you are saving into?

  • 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.

  • looks like using a rich-text metadata column type remains an open issue. any updates from folks that have that working?

  • has anyone found a way to support the rich-text metadata column type?

  • 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?

    • 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.

  • 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?

  • 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 😉

  • 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

  • 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.

  • 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.

  • Nope, all good, umpteenth time lucky, but not sure why, must have been a typo somewhere. Thanks 🙂

  • 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?

  • This was a great solution! Implemented in my Organization immediately for automatic report generation. Saves so much of time and money (Didnt have to buy the Microsoft word connector in PowerAutomate ;)) Thank you!!

    • This is just what I was looking for Laura, I have set up the flow, the flow works, but I get an error in the ‘Get file content new file’ section. This means that it creates the file perfectly, but it won’t move on to the email section.
      {
      “status”: 404,
      “message”: “File not found\r\nclientRequestId: 7350aeed-759d-470f-84a3-01e9b2aeb9dc\r\nserviceRequestId: 7350aeed-759d-470f-84a3-01e9b2aeb9dc”
      }

    • It looks like you’re using the File Identifier dynamic value, but in the blog post I’m using the ID of the file.

  • How do I give read only access for the clients before sending file in email please help me it’s urgent

    • Information rights management is the only way to control whether someone can edit something after you’ve sent it to them in an email.

  • I have the same issue as a few other people on this thread & I am hoping for some feedback on possible solutions.

    I am using a SharePoint list with 3 columns (employee name / date / salary), I have a document library with the same columns for my *.docx template file and a document library with the same columns for the *.docx files my flow creates.

    My power automate flow creates a new *.docx file correctly (uses the employee name), but the fields within the document aren’t populated with the information that was placed in the SharePoint List. IF I go into each *.docx file that was created and go to “Info” properties, the information I input in the SharePoint list is shown. IF I re-insert the document property from quick parts it displays it correctly. (this obviously isn’t a fix/solution b/c it would be tedious to do this to every field & negates the automation part of this task).

    I am wondering if this is now a Microsoft 0365 Word problem as it doesn’t update/display the fields correctly or if there is an issue with something else.

    I have re-created the template (*.docx) file 3 times and I still can’t get the document properties to display properly.

    So my questions are:
    1. Has anyone been able to resolved this issue? If so, how?
    2. If I were to get a premium connector would this fix the problem?

    • When you do the action to create the file, are you then doing an “update file properties” action, (step J) to add the metadata? I still use quick parts in some of my solutions, and they seem to work fine.
      Also, in the time since this post was originally written, Microsoft has created a cool action in flow that can be used instead of quick parts. It’s a Microsoft Word template, premium connector. I teach about 2 hours of training about this, in my advanced Power Automate course:
      in module 8: https://www.iwmentor.com/courses/flow

  • Thanks @wonderlaura – I had a look again at my doc library and list settings, I have it working now. I have the template in the same folder where the *.doc files are being populated and it looks great.

  • This is brilliant! Thank you so much Laura! 🙂

  • This is great providing you don’t have a currency, date or percentage field as quick strips out the formatting and returns just a number

  • Hi Laura, after I create a new item in my SP list, my PA workflow creates a new word document from the template and that document has the list values. However, when I try to email the document as an attachment, the list values are in the email body, but not the attached document. The attached document only shows the blank quick parts. Could you please offer any advice? Thank you, Debby

  • I was pulling it from the wrong SharePoint action, it’s working now.

  • Thank you for this solution! The template I am sending the data to has around 30 inputs, but the manual trigger limits my inputs to only around 20. Can you tell me how I can work around this? Again, this is brilliant! Thank you so much!

  • Thankyou so much! Works brilliantly!! Is there any way for a signature image to be passed into the document this way?

  • Thankyou SO much for this!! Works perfectly!! We now need to insert a signature into the form, is there a way to do this? The signature is saved as an attachment in the original SharePoint list but I cannot get it to populate the word document. Is there a way to do this?

  • Thankyou SO much!! This works perfectly for my situation. My next step is getting a signature that’s saved in the original SharePoint list as a JPG attached to be inserted into the document. Do you know a way to do this with this method? I can’t seem to find a solution. Thankyou!!

  • Hi, thank you for the great explanation. Unfortunately, im dealing with an issue using input from power app:
    when adding a button “submit” the run. function asks me to add 7 variables while in word doc I want to populate only 5. Where does this extra two came from?
    To try and solve it, i have added 2 more text inputs but the app fails with runtime issue :
    “Copyof-Auto-FillTemplate-19.Run failed: {
    { “code”: “WorkflowTriggerIsNotEnabled”,
    “message”: “Could not execute workflow
    ‘3abe1d43-ee36-4a14-bdb2-525804e39ac
    trigger ‘manual’ with state ‘Disabled’: trigg
    not enabled.” } }

  • Hi Laura, thank you for the great article and It worked like a charm! I do run into an issue. One of the Quick Parts control is a text field. The content in that text field is very long, it needs to be on two pages to show all the content. How can I make the content extend on the next page? Thanks!

  • Hi Laura
    I followed all the steps but the QuickParts Placeholders i created in Word Online will not show under the list of file properties.. Any advice with this please?

  • I want to merge data (site columns) stored in my custom Document Set into a Word Document. The Document Set defines the “case” while inside I store the documents, emails, pictures that relate to the case, these content types have their own unique columns. I’d like to be able manually trigger the creation of a Word document that merges the details for the case (site columns specific to the Document Set) that can then be printed or shared (emailed). Is this possible? When I go to create the Word document inside my Library and then go to add Quick Parts, the fields that are available appear to be specific for my “Document” content type. I’m looking for the data from my Document Set. Thoughts? recommendations?

  • Great post, thanks for walking through it. If I wanted to add a column after I have already created my word template, what’s the process to get that to show up as a quick part? Is there a way to refresh the available quick parts or do I need to re-create my template?

  • Thanks for the post, very helpful. Quick question though, say down the road I want to add a column to the library. How do I get it to show up as an available document property? Do I have to re-create the template or is there a way to refresh the available columns for the existing template?

    Thanks for any/all guidance you can provide.

    Regards,
    Cody

Leave a Reply