I am creating a 'version' list to create trend data (I do not have access to a sql db at this time). To do the versions, I am copying all list items to a 'version' list every day at the same time but the workflow takes several hours to complete. I would like the copy to be the status of all items at the time the workflow starts - will the query list bring all items into the workflow or does it reach out again to the live list when looping thru and therefore possibly get an updated version?
@btorres7 If the query list is outside the loop, all the data should be in the collection at time of action execution. If you have queries in a loop they would be executed each time through the loop and would be getting new data.
Actually - I just checked a running workflow that started early this morning: an item that was copied over that had been edited after noon copied over with the updates done to it - not as it was when the workflow started.
I am doing a query and then looping thru the collection to copy the item to the version list.
Any way to prevent that?
@btorres7 The copy item action is running on each loop which is why the data is changing. If you wanted the data to be set at the initial query you would need to store all the columns as part of the initial query and create/update item rather than copy inside the loop.
@leighburke So make a collection for each column? There are quite a number of columns. If I did, how do you make sure you are putting the correct collection items together when creating the item?
@btorres7 The collections should all be added in the same order, so long as you use the same index in your collection actions it will all be referencing the same row.
@leighburke So sorry but could you show me how you use the collection(s) to create the item with all the fields. (I see - it is a lookup field that I am trying to set....- on another site...)
@btorres7 You have your for each loop setup for one of your collections. Each other collection has get item from collection setup(https://help.nintex.com/en-US/nintex2016/current/#sp2016/zz-update/Workflow/ActionsCore/CollectionOp...), which will store the item from the same row in a variable. After you have pulled item from each collection, you use these variables in your create item action like below.
@leighburke I got that - just have an issue now with the lookup fields to lists on another site (used site columns to create them - the workflow is on a subsite).