Removing items from the variable returned by Get Queue Items

When I use the ‘Get Queue Items’ activity, I get a variable of the type IEnumerable<QueueItem> with a list of transactions (in this case with the New status).

I use ForEach to iterate through the list to find one I want to delete (I find it based on data in its SpecificContent). I then want to use Delete Queue Items which accepts a IEnumerable<QueueItem> variable.

How do I remove items from the originally returned IEnumerable<QueueItem> variable?

I tried to create a temporary IEnumerable<QueueItem> variable and copy the one i want to delete over so I could supply ‘Delete Queue Items’ with the temporary one, but I cannot figure out how.

If I’ve got the correct understanding of your situation…

You should be able to use the name in your “For Each” statement, ie the default of “Item” and send this as the IEnumberable variable to the delete queue items activity.

1 Like

Thanks, but it doesn’t seem to work. If I pass item to the Delete Queue Items activity, it complains about Option Strict On disallows implicit conversions from 'UiPath.Core.QueueItem' to 'System.Collections.Generic.IEnumerable(Of UiPath.Core.QueueItem)'

I figured it out though, I just use New List(Of QueueItem)({item}) as the argument for Delete Queue Items.

Also in my first post, for some reason whenever I wrote IEnumerable<QueueItem> it only showed as ‘IEnumerable’. I edited the post to fix it.

Hi, …any update on this?

I am not able to add queue items to a variable: “QueueListForDelete” as a “IEnumerable”

After using “Get Queue Items” activity and chosing those items I want into that new list (QueueListForDelete) I found out that there is no .add method.

Any help?

in short: the I from IEnumerable let allow you read only from this
But you can quick do: DataType: List(Of QueueItem) |
myFoundQueueItems= YourGetItemsOutputVar.ToList()

then you can continue to work with myFoundQueueItems