Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
I have the same problem. The workflow creates a folder in a library, passes the ID back to a local variable, but when that variable is used to reference the folder, the ID number is incorrect by a value of -1. Also looking for a reason as to why this happens and how to compensate for it. Sunny –  user16949 May 13 '13 at 1:06
    
next time please use comments –  Alex Choroshin May 13 '13 at 6:02

1 Answer 1

up vote 1 down vote accepted

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 :)

share|improve this answer
    
I've edited my original question to use your suggestion as a 'workaround'. The idea of having the second workflow on the document library instead of the original list hadn't crossed my mind. That is a workable solution should the folder ID reference issue remain unsolved. –  tyshock Nov 9 '12 at 15:24
    
Don't know, but wait for few days - or start a bounty on the question to get attention of experts :) –  Arsalan Adam Khatri Nov 9 '12 at 16:27
    
I've marked this as the accepted answer. It feels like a kludge to have a second workflow wired up just to get the correct ID. However, that is the most straightforward solution. I just made sure to document the workflow clearly. –  tyshock May 13 '13 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.