I am using Add Queue Item activity in UiPath Orchestrator.
I have an array like below that I want to pass as one of the values in SpecificContent:
Example array:
[{
Source: AWY
Destination: SBT
Seat selections for multiple travelers [{Passenger : First Name , Seat No : 20},{Passenger}, {Passenger : First Name , Seat No : 21}]
},
{
Source: SBT
Destination: TRR
Seat selections for multiple travelers [{Passenger : First Name , Seat No : 67},{Passenger}, {Passenger : First Name , Seat No : 89}]
},
]
Currently, SpecificContent accepts key–value pairs, and when I try to pass an array directly, it does not work as expected.
Other than converting the array to a normal string and passing it, is there a supported way to pass an array as part of SpecificContent and retrieve it later while processing the queue item?
SpecificContent doesn’t support arrays or objects directly, only key–value pairs. What usually works is converting the array to JSON and storing it as a string. When you read the queue item, deserialize it back to an array/list and process it. That’s the standard and reliable way to handle this in UiPath queues.
Since SpecificContent cannot “see” the internal structure of your array, you must package it into a JSON string during the Add Queue Item phase and unpack it during the Get Transaction Item phase.
Phase 1: Adding the Item (The Dispatcher)
To pass your array, use the Newtonsoft.Json library (already built into UiPath).
1. Variable: Let’s say your array is arr_TravelData.
2. Activity: In the Add Queue Item activity, click the ItemInformation (SpecificContent) ellipsis.
3. Entry:
a. Name: “TravelDetails”
b. Value: Newtonsoft.Json.JsonConvert.SerializeObject(arr_TravelData)
c. Expert Tip: By using SerializeObject, you preserve the complex nested structure (Passengers, Seat Nos, etc.) exactly as it is, without losing the schema.
Phase 2: Retrieving the Item (The Performer)
Once the Performer picks up the item, the value inside “TravelDetails” will be a string. You need to turn it back into a usable object (or a JArray).
a. Activity: Use a Get Transaction Item (variable: out_TransactionItem).
b. Logic: Use an Assign activity to deserialize the data.
- To: json_TravelArray (Type: Newtonsoft.Json.Linq.JArray)
- Value: Newtonsoft.Json.Linq.JArray.Parse(out_TransactionItem.SpecificContent(“TravelDetails”).ToString)
Using JArray or JObject (from Newtonsoft.Json.Linq) allows you to query the data dynamically later without complex string manipulation (like Regex or Substring).
Example of retrieval after parsing:
If you want the Source of the first element:
json_TravelArray(0)(“Source”).ToString —> Returns “AWY”
If you want the Seat No of the first passenger in the first flight:
json_TravelArray(0)(“Seat selections for multiple travelers”)(0)(“Seat No”).ToString —> Returns “20”
Note:- Remember that a single Queue Item has a size limit (roughly 2MB in most Orchestrator configurations). If your array contains thousands of rows, consider splitting them into individual queue items instead.