Adding dictionary to queue and retrieve dictionary from queue

is there any way i can add a dictionary to a queueitem (the dictionary may have different number of values for each queueitem)?

then when retrieiving transaction item, retrieve back the dictionary and do our own splitting?

Yes, you can use the Item Collection property.

Activities - Add Queue Item - https://docs.uipath.com/

Hi @TyraS

The following thread contains the required data:

Hope this helps,
Best Regards.

Hi @TyraS

Can you follow the below steps

  1. Create a Queue variable to store the dictionaries. Let’s call it queueData . You can define this variable in the Variables panel or by using the Assign activity with the following
new Queue(Of Dictionary(Of String, Object))()

This creates an empty queue that can store dictionaries with string keys and object values.

  1. Create a dictionary that you want to add to the queue. Let’s call it dictData. Populate it with the desired key-value pairs.

  2. To add the dictionary to the queue, use the Add To Collection activity. Configure the activity as follows:

  • Collection : queueData
  • Item : dictData
  • CollectionType : System.Collections.Generic.Queue<System.Collections.Generic.Dictionary<System.String,System.Object>>

This adds the dictionary to the queue.

  1. U se the Assign activity to assign the dequeued item to a variable. Let’s call it retrievedDict . Use the following expression:
retrievedDict = queueData.Dequeue()
  1. You can now use the retrieved dictionary (retrievedDict ) in subsequent activities.
Assign activity : queueData = new Queue(Of Dictionary(Of String, Object))()

Assign activity:
   dictData = new Dictionary(Of String, Object)()
   dictData.Add("Key1", "Value1")
   dictData.Add("Key2", 123)

Add To Collection activity:
   Collection: queueData
   Item: dictData
   CollectionType: System.Collections.Generic.Queue(Of System.Collections.Generic.Dictionary(Of String, Object))

Assign activity:
   retrievedDict = queueData.Dequeue()

Message Box activity:
   "Retrieved Dictionary : " + retrievedDict("Key1").ToString() + ", " + retrievedDict("Key2").ToString()

Regards
Gokul

Hi, is it adding to queue in orchestrator?
Each time will only add 1 dictionary though, will we still need the Add to Collection?

sry is a little confusing