Delete all items of certain type

Hi @MaciejSartys,
I dont see any other way other than using a custom workflow or an API call to solve this given your orchestrator version does not filter as @Maneesha_de_silva showed. I understand this might not be what you wanted, but below is the alternative solution.

A workflow approach:

  1. Get queue items - Select the “QueueItemStatus” in properties : This will result in an enumerable which consists of all the items. Supported QueueItemStatus are New,Successful, Failed, InProgress, Abandonded, Deleted, Retired. (If the type is InProgress, check the reply in this thread. There is also a .xaml file in the reply, which you can adapt to your case.)
  2. Use For each loop and select TypeArgument as “QueueItem” as the enumerable in Step 1 contains "QueueItem"s
  3. In the “do” section of the for each loop, use Delete Queue Items and pass the “item” to be deleted.

This way the items will still remain in the queue with a “Deleted” status so they are still accessible visually and their data is still accessible programmatically (Get Queue Items → Deleted → ItemData).

@mahesh.kumar I did not understand what you meant by not recommended to make database changes. If by chance there is a wrong item in the queue, we do have to handle them. Creating a new queue every time is not going to be scalable and it might also affect API calls which use queue IDs.

1 Like