How to retreive <INumerable<QueueItem>> type from the Queue

So here is a step by step process of what I am trying to do.

  1. I am converting a data table into JSON format using data table to JSON activity ( Output is JSON string ).
  2. I am deserializing the JSON string, the output of it is in a JArray format. Using for each, I am adding the values into the queue.
  3. Now I need to pick values added to the queue and use it for comparing values in a Excel Sheet.So for that I have used Get Queue items and the output of it is in <INumerable> type.
  4. I have attached the screenshot of how my queue item looks like after adding, I need to retrieve specific values from the Queue for comparison.

Please help me with the solution.

Thanks,
Manu

@Nair_Manu_Shankar What is the type of item1 in the For Each of QueueOutput?

It’s the same as item in the previous for each. I have just changed the name for my understanding.

@Nair_Manu_Shankar I meant What is the Value of the TypeArgument in that For Each ? It Should be QueueItem

Oh, it is UiPath.Core.QueueItem.

@Nair_Manu_Shankar Then you should be able to access the value from the Queue Item using item1.SpecificContent(“AccNumber”).ToString

Yes I am getting the output but I want specific values from the Queue item and not all the four.

@Nair_Manu_Shankar Then you would need to Deserialize it to a json object and access the values using the Json Object.

It might be in this way :

jsonOutput(“1”).ToString

But the output of “Deserialize JSON Array” will always be in JArray format right ? Can I change that ? If yes, how do I do that ?

@Nair_Manu_Shankar Can you try by using Deserialize Json Activity ?

Yes I tried. It is not working.

@Nair_Manu_Shankar What was the Error?

@supermanPunch Please find the attachment.

@Nair_Manu_Shankar Where did you use the Deserialize Json Activity? Didn’t you use it inside the For Each Loop with item1.SpecificContent(“AccNumber”).ToString as the input?

After converting the data table to json.

@Nair_Manu_Shankar No Not at that time. You need to Desrialize the values while retrieving the values from the Queue right? So it should be inside the For Each Loop of the QueueOutput

Do this

@supermanPunch Getting this error.
“Deserialize JSON: JsonToken EndArray is not valid for closing JsonType None. Path ‘’, line 1, position 1.”

@Nair_Manu_Shankar Can you show the Screenshots of the Workflow indicating the changes that you have done?

@Nair_Manu_Shankar If the TypeArgument of Deserialize Json Activity is JsonObject then it should have worked fine.

If possible use a Message Box before the Deserialize Json Activity with item1.SpecificContent(“Patient_Details”).ToString as it’s value and send the Screenshot of the value. In this way we can identify if the data is in proper Json Format.