I have a Library called Intake with a property field called Assignee. The column called Assignee allows multiple values. I want to loop thru the library and copy an individual item from the Intake library to another document library called "Owners" (within the same site) for each value found in the Assignee column.
Thus if the Intake Library has 1 item and the Assignee field contains 2 values: Tom and Jerry. Then I want to copy the same item twice from the Intake library to the Owners library. I do realize in the Owners library that the Name will display a time stamp since the same file is being loaded multiple times. In addition I will do a Set Value so the Owners item has the individual assignee's name.
Essentially my question is using my example how can I determine that I need to copy the item twice into the Owners library. I am somewhat familiar with Query List, For Each, and Collections which I assume I need to use, but determining how to iterate on each value found for the Assignee field has me stumped ?
Solved! Go to Solution.
You can use the query list and store the field value in single line text. Use collection operation to split (by semi-colon) and store that in a collection variable. Now use for each loop to iterate through the item. Depending on the no of iterations you can copy the item.
I had a similar of multiple values when I used the repeating section(with 3 columns) in my form. Due to the repeating section I had multiple values for each of the column. Using this http://vadimtabakman.com/nintex-workflow-iterate-through-related-collections.aspx I iterated values and stored in variables and used the create item action to create item for each value.
Sojan...can you clarify your statement "Depending on the no of iterations you can copy the item." Is there a limit on the copy items ? I do not expect i would be copying more than 10 items from a single item in the Intake library. thx !
Also..I think you intended to indicate I should do a "Regular Expression" for the split ?
As Sojan suggested, you can use regular expression to split the Assignee field into mutiple values in that collection. Then use For each to iterate through those values. In each loop you can copy the document along with the assignee value to the target library.
I dont think there is currently a limit on the collection action.
when you split the assignee, and store them in a collection variable. You can loop through the collection variable using foreach. If there are 2 assignee the collection variable will have 2 item. I dont think there is a limit for the item to copy.