"queueItemParameters must not be null" Error while posting Json array while using Orchestrator API(AddQueueItem)

Hello Team,
I am getting below error while post Json array in specific content while using Orchestrator API(AddQueueItem). Could you assist here please.

“queueItemParameters must not be null”

https://cloud.uipath.com/AAA/XXX/orchestrator_/odata/Queues/UiPathODataSvc.AddQueueItem

Sample Data :

{
	"itemData": {
		"Priority": "Normal",
		"Name": "Test Queue",
		"SpecificContent": {
			"eventType": "Start",
			"Test": [{
					"seq": 1,
					"loc": {
						"address": {
							"city": "ABC",
							"state": "XX",
							"zip": "1234"
						}
					}
				},
				{
					"seq": 99,
					"loc": {
						"address": {
							"city": "YYYY",
							"state": "AR",
							"zip": "54321"
						}
					},
					"comments": [{
							"type": "Test Comment Data",
							"value": "comment 1"
						},
						{
							"type": "Test Comment Data 2",
							"value": "comment 2"
						}
					]
				}
			]
		},
		"Reference": "ABCD"
	}
}

Thanks, G

2 Likes

Hi @gowtham.jayavel

Check whether you have given all the parameters to add in the queue (Add queue item)

Regards
Sudharsan

Hey,
I used very simple HTTP request and item has been added to queue.

{
“itemData”: {
“Priority”: “High”,
“Name”: “queueTest”,
“SpecificContent”: {
“key1”: “value1”,
“key2”: “value2”
}
}
}

Maybe you will try use very simple request and gradually add new parts of data.
In this way you will see which part generating issue :slight_smile:

Hi @pikorpa Thanks for your reply, Seems to be failing while we send JSON Array in the specific content.

“Test”: [{
“seq”: 1,
“loc”: {
“address”: {
“city”: “ABC”,
“state”: “XX”,
“zip”: “1234”
}
}
},
{
“seq”: 99,
“loc”: {
“address”: {
“city”: “YYYY”,
“state”: “AR”,
“zip”: “54321”
}
},
“comments”: [{
“type”: “Test Comment Data”,
“value”: “comment 1”
},
{
“type”: “Test Comment Data 2”,
“value”: “comment 2”
}
]
}
]

I think you cannot add to the queue of array with values.
Description of SpecificContent → A collection of key value pairs containing custom data configured in the Add Queue Item activity, in UiPath Studio.
So it can be only collection: key → value
When I tried add the array used the activity ‘add queue item’ in UiPath Studio I also get the same error message:


2 Likes

Sure, Thank you.

@pikorpa pointed out SpecificContent is Dictionary(Of String, Object), so if you want to add a more complex JSON object that contains Arrays / Objects, you must first serialize the JSON.

{
  "itemData": {
    "Name": "asdf",
    "Priority": "High",
    "Reference": "{{$guid}}",
    "SpecificContent": {
        "Test" : {{specific_content}}
    }
  }
}

In the above specific_content is the value string of the following (Using Postman)

const TestData= [{
        "seq": 1,
        "loc": {"address": {"city": "ABC", "state": "XX", "zip": "1234"}}
      },
      {
        "seq": 99,
        "loc": {"address": {"city": "YYYY", "state": "AR", "zip": "54321"}
        },
        "comments": [
          {"type": "Test Comment Data", "value": "comment 1"},
          {"type": "Test Comment Data 2", "value": "comment 2"}
        ]
      }]

pm.environment.set("specific_content", JSON.stringify(JSON.stringify(TestData)));

which results in specific_content with the string value of "[{\"seq\":1,\"loc\":{\"address\":{\"city\":\"ABC\",\"state\":\"XX\",\"zip\":\"1234\"}}},{\"seq\":99,\"loc\":{\"address\":{\"city\":\"YYYY\",\"state\":\"AR\",\"zip\":\"54321\"}},\"comments\":[{\"type\":\"Test Comment Data\",\"value\":\"comment 1\"},{\"type\":\"Test Comment Data 2\",\"value\":\"comment 2\"}]}]"

image

image

You would then have to deserialize the JSON string in “Test” value when you fetch the queue item.

5 Likes

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