Today's Deals (in Amazon.com)

 Question:

sharepoint designer - The workflow could not create the list item?
  • Arash Kh

    I would be grateful for any help/pointers

    I am getting “The workflow could not create the list item. Make sure the list exists and the user has permissions to add items to the list.”

    My scenario

    I’m trying to create a new document in a library (List B) using a SPD 2010 workflow. The originating list (List A) has a status dropdown, so when the user selects “done” – A document will be created using 2 or 3 fields from the original list.

    My attempted solution

    I am using a hosted SharePoint 2010 foundation test site. I created a basic team site

    1.Created my List A with the following fields with some dummy data

    SalesPerson(Single line of text)

    Total Purchased(Number)

    Quantity Purchased(Number)

    2.Created a site content type with the same field names from the List A 3.Created a document template based on this content type in which I inserted the necessary fields (using insert Quick Parts) 4.This template was uploaded and saved to the site and renamed from dotx to docx 5.Deleted the default content type for List B and replaced it with this new document 6.Opened SP designer 2010 to create my workflow below

    If CurrentItem:Status equals Done Create Item in ListB (Output to Variable:create)

    The options selected within ListB are:

    Content Type ID(Inv001)

    Path and Name(*)(http://mysite/MSSPD/Comp%20Invoices/Forms/AllItems.aspx)

    Sales Person(Current Item: Sales Person)

    Quantity Purchased(Current Item: Quantity Purchased)

    Total Purchased(Current Item: Total Purchased)

    (I have a feeling the Path and Name field is incorrect but not sure what syntax I should be using??)

    7.Checked for errors (none), saved and published (Workflow is set to start automatically when an item is created or changed) 8.When I change the status to “done” the workflow column initially states “In progress” then “Error occurred” 9.When I click on the error I get the following: “The workflow could not create the list item. Make sure the list exists and the user has permissions to add items to the list.”

    I am logged in as Site owner so have the permissions to create items in ListB

    Any help appreciated

  •  Answers:

  • concernedposter

    Took me a while to find this again:

    Hello again,

    Not sure if anyone is still following this, but I managed to do a workaround after much frustration:

    1. Create a page with the content type you want to create via Workflow normally

    2. With SharePoint Designer open the directory, highlight the file you created and choose export - then save it to somewhere on your computer

    3. Go back to the List you will create the items in, and under "List Settings" click on the content type in question then choose "Advanced Settings"

    4. Choose "Upload a new document template" browse to the saved file and upload it

    5. Now you can create the WF in SPD - the "Path and Name" can be set normally - no need for adding relative paths, if you set it to "Something" it will create it as "Something.aspx" under the wiki library for example - content type should be of course the one we modified.

    Notes:

    • This will render the normal document creation button for some reason unusable - this is not a problem in my case, as we use it to mass upload wiki pages - but they don't seem to function parallel.

    • In the workflow you can of course set fields normally for the newly created page

    • You can also create one Workflow to create different content types based on conditions but then you have to upload a template like above for each content type (and manual creation won't work afterwards)

    • If you want to switch back from the template - under advanced settings just switch the template file to "/_layouts/CreatePage.aspx"

    Hope this will help others - it sure did to us (not having to manually create 7000 wiki pages individually)

  • Cory

    Sounds like a great idea. However creating a document by using the create items from a SPD workflow will not work. This is only meant to create list items not documents from content types. With document libraries you could copy items from library a to library b but not create a new item in library b from list a. For this you will most likely need a Visual Studio workflow or list event receiver.