The Create List Item workflow action does not work in document library with document template


  • My end goal is more complex but below is a basic example of the issue I’m having that just simply does not work.

    I'm trying to use a site workflow to create an item in a document library that has a document template applied to it but the file that gets created by the workflow is corrupt and cannot be opened.

    I created a document library and edited the document template by adding some text to the header and changing it to a Word docx file instead of a Word dotx file. I tested the document template by clicking the files tab in the ribbon and then clicking new document which opens the document template in Word and allows me to edit and save the document back to SharePoint. Then I created a SharePoint 2013 site workflow in SharePoint Designer that contains a single Create List Item action, and that action creates an item in the document library with the name field statically defined. I published the workflow and then manually start it on the site. The workflow completes successfully and when I navigate to the document library the document has been created by the workflow. When I click on the document to open it in the Word Web App it throws the error pictured below and if I open it in the Word client application it just opens a blank document and not the correct document template.

    Word Web App Error

    I also tried using a SharePoint 2010 workflow with pretty much the same results. Opening the document in Word Web App gives the same error as above and opening the document in the Word client application gives the error pictured below.

    Word Client Application Error

    Come on Microsoft creating a Word Document in a SharePoint Document Library from a SharePoint Workflow should just work! Is this a bug or does anyone have any ideas on what is causing the this issue?

    Tuesday, August 20, 2013 8:52 PM

All replies

  • I have the same issue and researching found many others with this same problem. Looks like I will need to use up one of my limited calls to find out if this basic functionality has a work around or a fix.
    Wednesday, August 21, 2013 2:53 PM
  • Did you find a work around or a fix for this?
    Thursday, August 29, 2013 6:59 PM
  • I might be late in replying to this question; but for anyone who is looking for an answer.

    In your workflow you need to select "ContentTypeId" and set it as your custom document template (.docx) for it to work. This is done at the place where remaining fields are  mapped.

    • Proposed as answer by NBurgess Thursday, March 13, 2014 9:31 AM
    Tuesday, February 11, 2014 11:21 AM
  • I'm having the same problem and I confirm that I have (i) selected "Content Type ID" and set it to my custom doc template, (ii) that the template works outside of the workflow, and (iii) the workflow completes without an error. Thanks!

    Tuesday, February 18, 2014 4:30 PM
  • Yes Shannon, I also tried using a content type with a document template and specifically chose it's Content Type ID but still the workflow creates a corrupted document.

    Tuesday, February 18, 2014 4:40 PM
  • I had the same problem with corrupted document - this worked for me:

    1. Create a 2010 Workflow which creates the list element in a document library
    (you may start this workflow from your 2013 workflow if applicable)

    2. In the Create New List Item properties - make sure to set ContentTypeId to your content type
    ("Id for indholdstype" is Danish for "Contenttype ID")

    3. Your Content Type template should be a ".docx" file - NOT a ".dotx" file...!

    (I have always created my templates for content types as .dotx files - seems Microsoft wants us to use ordinary .docx files as template files for content types)

    Hope this helps you!

    Wednesday, March 12, 2014 9:51 AM
  • Me too - until I changed the template from a dotx to a docx file - works now!


    • Proposed as answer by SJNBham Tuesday, December 16, 2014 12:31 AM
    Thursday, March 13, 2014 9:30 AM
  • Just to be clear, I got this to work by specifying a .docx as the content type template vs. the default .dotx which failed. 
    Tuesday, December 16, 2014 12:29 AM
  • Hi,

    I also have this problem and I'm using a .docx.

    Am using Onsite SharePoint 2013, SPD2013 with 2010 workflows and Word 2013.

    When I add a document with a .docx template from a content-type using the New Document button on the Files Ribbon I am able top open with Word 2013.

    When I add it using the "Create List Item" action in a 2010 Workflow it is created but when I attempt to open it with Word 2013 I get: "We’re sorry. We cannot open <var class="sbody-var"><file_name></var> because we found a problem with its contents."

    The article at suggests a workaround but this would remove any benefit of using content types.

    The article then goes on to explain that the problem is by design. Can someone at Microsoft please explain?

    If anyone has any suggestions I'd really appreciate it. At the moment I've hit a roadblock as I really want to create a document from a content-type that is pre-filled with data from the site.

    Many thanks.

    Tuesday, July 07, 2015 2:57 AM
  • Are there any news on this?

    My .docx-template is working perfectly fine whenever i select new item in the ribbon, but when using a workflow to create the item the template isn't working.

    Unfortunately using a 2010 workflow is not an option in my setup.


    Tuesday, October 13, 2015 12:52 PM
  • Please make sure that the document template (the content type document template) is doc or docx, and NOT dotx.
    In the workflow - Create Item - Path and Name should contain the name of the file and the correct file extesion (exaclty as the document temple extension).

    for me the workflow created a corrupted word document because the template was dotx and in the workdlow I created a docx, once I changed the content type document template to a docx the problem SOLVED

    • Edited by Noam Meir Thursday, October 26, 2017 6:24 AM
    Thursday, October 26, 2017 6:22 AM