Skip to main content

Dear community,

I found various threads discussing this issues, but unfortunately I am still struggling to get this to work.

I have list tracking status of different items with multiple collumns and items. The list ist continuously growing and I am looking for a way to archive items that are no longer active.

I have created an empty copy of the Main list, and named it Archive.

One of the columns is called Enddate, and I would like to move weekly all items where "Enddatum = Today()-30" (i.e. days) to Archive; and then delete the items from the mainlist.

I tried creating a schedulded site workflow with "Copy Item" where Enddatum equals Today()-30 to Arhive, followed by "delete item". This would not work for me.

I am rather new at Nintex, and would appreciate the support!

Thanks

Hi,

this shouldn't be too hard actually. Just create a site-workflow like this:

199706_pastedImage_1.png

At first you have to calculate the date from which on items should be archived and store this in a variable (vArchiveDate)

199707_pastedImage_2.png

Then query the list to get all items, whose end-date is less than the archive date.

199708_pastedImage_3.png

Finally you loop over the list of IDs create a copy of the item and then delete the item.

Instead of deleting every item individually you could also use the "delete multiple items" action, which uses the same filter-setting as the query-list-action:

199709_pastedImage_4.png


Thank you for the quick and extremely helpful answer! 

As I am still a bit confused, I have a follow up question. 

How should I setup "for each" function? That is:

Target collection? 

Store result in? 

Index? 

I assumed that for the query I should create a new workflow variable (vColArchivelds). Hopefully this is correct!

Thank you again :-)

Bests,

Paavo


Hi,

here you go:

200046_pastedImage_2.png

200048_pastedImage_4.png

and just in case:

200047_pastedImage_3.png

The Index of the loop-action is not needed in this case, so you can just leave that empy.

Please remember to mark my reply as helpful/correct - if appropriate.


Awesome! Thank you :-)


don't forget to mark the answer as correct! wink.png


Excellent!  


When I run this the newly created items on the archive list start the workflows from the original list. Is there are way to prevent that?


Thank you so much!!! your post saved me and my time. Great post. :)


I know it is 1 1/2 year ago the solution was posted but I hope someone can help me.

 

I have a similar question and tried this solution but when I copy from List A to List B item 2 and 3 is overwritten with data from item 1...

 

I have a Task list (List A) which is connected to a Project list. In List A I have several look-up columns to the Project list. One of them is Project status. I want the workflow to go through List A once a month and copy/move all tasks with Project status "Closed" to my Archive list (List B) and then delete the task from List A. I have followed the above steps and started at "Query list". But as I wrote all items get the same data.


That seems odd. Sounds like you're looping but you are not updating the current-item-id. You should check the "Store current result" of the for-each action as well as the copy-item action. Both have to use the same variable.


Thank you for the answer. Now it works! I had put in the wrong variable in copy-item action...


I really hope you can assist me, could you show how to archive and delete the item in another library in sharepoint 2019. I have a library with more than 1000 items and needs to be archive. Many thanks


Reply