In Nintex For Office 365 is it possible to delete all items where Created is older than 12 months ?.
One approach can be that you mark the items 'to be deleted' and then delete them.
I will add an Update Item action and tick Select items only when the following is true:
Build your query based on the Created column and a Date/Time variable.
Update a new column Status with 'To Delete'
Then you use the action Delete Items and use Status for your 'equals' condition
You can do a List Query action and filter based on Created by is older than 12 months. The 12 months can be calculated in a variable. Loop through the items that are older than 12 months and delete them.
How exactly do you calculate the 12 month age via variable?
Take whatever your reference date is (maybe the created date?) and using the Add Time to Date action, in the Months section use the value -12. The output will go to a variable you specify.
Awesome thanks! What is the best method for deleting? Right now I' musing an Office 365 query list action and return the GUID of items meeting those criteria and then I use a For Each action to iterate through the dictionary and added a delete item action within the for each loop and reference the GUID. Sometimes I get throttled based on CPU action when using this method. Any thoughts on why?
Throttling will happen because you are making too many expensive(in the eyes of a CPU) calls in a given period. SharePoint is doing the throttling. You are doing this in the correct way, what you can do is utilize the Stop Processing option in the For Each loop and stop after X items. Have a Pause for 1 minute, then utilize a State Machine to help you continue processing until all items are removed (by starting the same branch with the ForEach over if items still remain.
If you were to do this through code or CSOM, you would have to program it the exact same way so this is not a unique concept to workflows.
Retrieving data ...