Skip to main content
Nintex Community Menu Bar
Solved

Loop through list and delete items IF...

  • January 16, 2025
  • 3 replies
  • 31 views

Forum|alt.badge.img+10

Hello!

I am trying to loop through a list and ONLY delete items based on a specified date and status. I setup a component workflow and ran a test and accidentally deleted everything in my list…. which wasn’t suppose to happen. HELP?

 

My requirements are REMOVE anything that is before:

Dec 1, 2024

AND

If the Request Status  is:

PENDING APPROVAL
REJECTED
Empty
Pending changes status
Pending Reviewer Approval

 

I used a Branch by Stage and didn’t know if that was the right approach or not..

My workflow steps are below. TIA!

 

Best answer by Prineel_V3

@jpacheco 

You can put those conditions in your “Query a List” action, under the “Conditions” section. The query will only return those items. You can use the demote button to section your conditions allowing you to have both “And” and “Or” conditions
 

Please make sure you use your date and status variable. I’ve used the default sharepoint “Created” column as an example

In your delete action, you need to specify which items you want to delete using conditions. Since the query is already returning the correct items that you want to delete (because we added conditions to the query), you only need to select the Item ID property from the loop for each tab:
 

This is what your Delete Items conditions should look like

Overall this is what your workflow should look like:
 

 

View original
Translate
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+8
  • Nintex Employee
  • 82 replies
  • Answer
  • January 16, 2025

@jpacheco 

You can put those conditions in your “Query a List” action, under the “Conditions” section. The query will only return those items. You can use the demote button to section your conditions allowing you to have both “And” and “Or” conditions
 

Please make sure you use your date and status variable. I’ve used the default sharepoint “Created” column as an example

In your delete action, you need to specify which items you want to delete using conditions. Since the query is already returning the correct items that you want to delete (because we added conditions to the query), you only need to select the Item ID property from the loop for each tab:
 

This is what your Delete Items conditions should look like

Overall this is what your workflow should look like:
 

 

Translate

Forum|alt.badge.img+10
  • Author
  • Scout
  • 82 replies
  • January 17, 2025

@Prineel_V3 ,

 

You’re a ROCKSTAR! OMG, too, I’ve been trying to figure out how to use the AND/OR in the condition and you’ve shown me how its done! Your explanation helped me understand what needed to be done and it all worked out perfectly!

 

Thanks again!

Translate

Forum|alt.badge.img+8
  • Nintex Employee
  • 82 replies
  • January 17, 2025

You're Welcome :)

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings