Question

I have a SharePoint Designer workflow on a custom list that creates a corresponding folder in a document library. I then want to associate the firing list item to this newly created folder using the folder's ID. I have the workflow correctly creating the folder, but the reference that I get back as the 'Output to' variable for the 'Create Item' workflow action is incorrect. For example, 'Create Item' will get called, and the output variable will be set to an ID of, say, 68. However, when I go into the document library, the folder has been created, but actually has an ID of 70. I need the correct reference (in this case, 70) to the created folder so that I can set the lookup value for it in the original list item.

In my workflow, I have also tried to add another step to locate the folder by name instead of relying on the output variable. However, this step will not return a value during the initial folder creation. It seems like a transaction issue to me, i.e., the folder I've created can't be independently found in the list until the original creation operation (my workflow) completes. However, the same workflow step will find the folder by name and correctly populate the value if I run it a second time (after the folder has already been created in the first run).

Right now, my only workaround is to implement a separate workflow on the document library which will fire when the folder is created and correctly create the lookup reference on the original list item. However, for maintainability, I would like to keep this logic within a single workflow.

Was it helpful?

Solution

I don't know about the problem;

But a quick workaround I can think of is to pass the lookup value, folder title and other information in the FOLDER TITLE [separated by '|', let's say] from this workflow which you already have! and then create a designer workflow on Item adding of the Document Library, which split all the parameters from Title [splitting the Title on '|'] and set the Current Item fields accordingly...

Unfortunately there is no Split action in String Actions but since you have definite parameters you can use multiple SubString Action's to achieve the values...

But I strongly recommend to wait for other guys to answer this question, if not - then try this method :)

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top