Create list item  in library - Output variable

Helo

I want to create workflow in SPD, that create new item in document library.

I use Create list item on library (output to Variable:create)

The documenty was created sucessfully, but the output didn't return the ID of item created.

In the documentation says, that function return the ID of item created.

Is maybe some other way, to get the ID of new created item in document library.

 

Best regards

November 15th, 2010 10:43am

Thats correct The output variable returns the ID number of the created item.
may I ask what you do with the output (store it in a list, or e-mail it to a user)

Free Windows Admin Tool Kit Click here and download it now
November 15th, 2010 11:20am

I want to store it, actually i want to create a link to that document.
November 15th, 2010 2:58pm

Oke, well the document library already has a hidden field called "ID" which it stores the ID in.
Its a column that you can access, so I don't see a reason to store the ID separately.
But if you want to anyway, you could use the workflows "Update List Item" and store the variable into a seperate field

But considering you want a Link to the file, why not use the hidden field "FileRef" of the document library.
It contains the exact URL of the file.

  • Edited by SWR1988 Monday, November 15, 2010 3:18 PM typo
Free Windows Admin Tool Kit Click here and download it now
November 15th, 2010 3:11pm

Thanks for answer.

But here is a problem, because i couldn't get the id of item. When workflow creates an item in document library, then the output variable don't return the ID.

Thanks for idea about fileRef. But here is also a problem, because i couldn't get that data, because i dont have that ID, and i don't know which item look for.

 

 

 

November 15th, 2010 4:05pm

Hi,

Yes, the variable create in the action Create List Item is of the data type List Item ID and store the list item id of the item created by the workflow.

If you want to update a column in the document item created by the workflow, please try to do the following steps: add an action Update List Item >click this list in action, select the document you want to update>in the Find the List Item section, select ID field of the document in Field dropdown list>click fx to define workflow lookup>select Workflow Data in Source dropdown list and select Variablecreate in Filed list.

This article can help you: http://office.microsoft.com/en-us/sharepoint-designer-help/use-variables-in-workflows-HA010240415.aspx

Hope it helps.

Free Windows Admin Tool Kit Click here and download it now
November 17th, 2010 6:14am

I can confirm that when creating a document set using SharePoint Designer 2010, the Item ID is not returned using "Create Item" action, using MOSS 2010. Logging the variable to the history list reveals that the variable is blank.

March 20th, 2012 12:05pm

Has this been fixed in either the April, June or August 2012 cumulative updates??
Free Windows Admin Tool Kit Click here and download it now
October 24th, 2012 6:44pm

This has not been fixed at least thru the August 2012 CumUpdate.  I had to to the subtract one thing to make it work correctly.
November 5th, 2012 10:58pm

I know this is and old post, but I had the same problem recently. This fixed it for me:

1. Create a local variable of type "Integer"

2. Set this new variable to the output parameter from your "Create New List Item" action

Now you can use your integer variable to find the newly created list item and retrieve further information (in my case I needed the encoded absolute url...)

Free Windows Admin Tool Kit Click here and download it now
March 12th, 2014 11:18am

This method does not work for me.
May 14th, 2015 12:39am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics