cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Copy all list items to another daily - query items updated?

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?

Labels: (1)
0 Kudos
Reply
19 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: Copy all list items to another daily - query items updated?

@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. 

Reply
Highlighted
Nintex Newbie

Re: Copy all list items to another daily - query items updated?

Thank-you!   That's all I needed to verify.

Unless you know of a quicker way to copy over items...?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Copy all list items to another daily - query items updated?

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.

btorres7_0-1595373179809.png

Any way to prevent that?

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Copy all list items to another daily - query items updated?

@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.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Copy all list items to another daily - query items updated?

@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_0-1595376629256.png

 

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Copy all list items to another daily - query items updated?

@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.

 

 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Copy all list items to another daily - query items updated?

@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...)

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Copy all list items to another daily - query items updated?

@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.

 

Workflow Designer - Internet Explorer49.png

 

 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Copy all list items to another daily - query items updated?

@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).

0 Kudos
Reply