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

    Question

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

    Nathan

    Thursday, March 13, 2014 9:30 AM