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

Deleting items in a document library

I am building a workflow to delete documents that are 7 days old.  Have tried using  "Delete Item" and "Delete Multiple Items".

I have a field in the list that calculates the created on date against the current date to get the number of days old.  Also have a calculated yes/no field that says if the number days old is greater than or equal to 7 then delete = yes.

When I do a "For Each" action with the "Delete Item" action filtering on items in the list where days old greater than or equal to 7 or delete = yes, one item is deleted even though there may be several that meet the critera.

When I use a "Delete Multiple Items", all the documents are deleted regardless of the specified criteria.

What am I doing wrong here?  

0 Kudos
Reply
4 Replies
smichals
Nintex Newbie

Re: Deleting items in a document library

Hi Sean,

Paste the screenshot with your workflow, especially with "For each" section.

Best regards,

Slawek

0 Kudos
Reply
seanobryant65
Nintex Newbie

Re: Deleting items in a document library

The two beneath Delete Item are disabled.  

0 Kudos
Reply
hein_taljaard
Nintex Newbie

Re: Deleting items in a document library

Hi Sean,

I set up a quick test to verify the behavior you are experiencing. I got the solution working by using a normal delete multiple items action. 

I suspect your query on the delete may be causing issues. Can you please run the delete multiple items on only the 1 field? Would you be able to provide a screenshot of the list?

As an alternative (not ideal though) you could do a query list, then bind the foreach to the collection. In the foreach, you can do the delete item on the ID of the current item in the loop. As I said, not ideal. You could also test the query by logging it to history to see what results you are getting.

0 Kudos
Reply
emha
Nintex Newbie

Re: Deleting items in a document library

When I do a "For Each" action with the "Delete Item" action filtering on items in the list where days old greater than or equal to 7 or delete = yes, one item is deleted even though there may be several that meet the critera.

can you post screenshot of both delete item and for each actions?

as well for each action should iterete over a collection variable - post as well screenshot of an action that populates the collection.

When I use a "Delete Multiple Items", all the documents are deleted regardless of the specified criteria.

can you post action configuration as well.

this should be prefered (more efficient) way how to delete multiple items at once.

a hint: you may test your delete filter/condition with a query list action to make sure it returns expected items.

0 Kudos
Reply