What is a valid IEnumerable UiPath data type for UiPath QueueItems

3.4k views Asked by At

I am trying to configure the UiPath get queue items activity but when I specify the QueueItemData variable as the output it gives a warning asking for a generic IEnumerable object.

What is the proper UiPath queue object to use when a IRnumerable object is required?

2

There are 2 answers

0
Wolfgang Radl On BEST ANSWER

You can simply use IEnumerable<UiPath.Core.QueueItem> as type for your variable. A simple way to create a suitable variable is to hit CTRL+K in an appropriate property field, like this:

Create variable using CTRL+K

Studio will then automatically add the variable after hitting Enter. You may need to change the scope manually.

enumerable queueitems

0
Cameron McKenzie On

You will want to use IEnumerable<UiPath.Core.QueueItem>.

Essentially, you can read that as this is an iterable collection that contains nothing but UiPath.Core.QueueItem objects.

Beware of Imposters

Be careful when you choose the generic type associated with the IEnumerable class though. There are many similarly named classes that can cause confusion, and if you choose the wrong one you'll end up with an error about being unable to case between one and the other.

enter image description here

Automatic Type Setting

When in doubt, allow the UiPath Studio tool to set the type for you. Just move the cursor into the input window for the field in question in the Properties tab and type set var: items. UiPath Studio will then register the variable and set the object type to the appropriate class. This takes the guess work out of figuring out which type to use.