Looping over "Get Queue Item" building a full "list" of all Queue Items

I have a need to get a full list of Queue Items that are in a “New” or “In Progress” state.

“Get Queue Item” returns a max of 100 IEnumberable. I do not understand how to get a block of 100 IEnumberable say stored in variable “getQueueItemsResult” (this part does work) and then append that to another variable, for example, called getQueueItemsALLITEMS … all the while dealing with the 100 Get Queue Items limit.

This IEnumberable vs Collection topic really confuses me. The bones of what I think I need to do looks this:

(sorry for the small image … trying to show logic)

The two steps in the For Each Body are just place holders as I don’t know how to take an “item” from getQueueItemsResult (IEnumberable) and use append/add/push/whatever it is into another variable called getQueueItemsALLITEMS. I don’t know what the type should for the variable getQueueItemsALLITEMS nor the operation to do the append/add/push/whatever to build it up.

Does anyone have a sample of how to loop over Get Queue Items (I’m only pulling NEW and IN PROGRESS) results building up a total-everything List/Collection/whatever it is to be used later ?

Ultimately this everything list will be used for a simple check that looks list this:

AllExistingNewInProgQueueItems.Any(Function(q) q.Reference.Contains(referenceValue) )

1 Like

Hey @riverrat437

Just try using list or array concatenation for the same.

Thanks
#nK

1 Like

Thank you for the reply !!!

Can you show me an example please ?

1 Like

Hey @riverrat437

If it’s an array variable arrVar.AddRange(newList)

Hope this helps

Thanks
#nK

In the end what I did was the following. The loop structure in my original post remains. I was only interested in the “Reference” column value itself for NEW and IN PROGRESS queue items. The loop itself is this:

getQueueItemsResult is a IEnumberable(QueueItem)

The Add to Collection is this:

getQueueItemsResult_List is a List(String)

The boolean check I referred to below is now this:

AllExistingNewInProgQueueItems.Any( Function(q) q.Contains(referenceValue) )

And it works just like I need it to :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.