Add bulk queue item error Operation returned an invalid status code 'BadRequest'

i want to add 42k row in queue so i used bulk queue item but i am getting issue
Operation returned an invalid status code ‘BadRequest’

@Ananya1 What do you mean by 42k row? Is it a Datatable ?

yes it is datatable which has 42k rows

@Ananya1 You might need to Serialize it and Add the Datatable as an Object to Queue and then Deserialize and Take the Datatable while using Retrieving Queue items. Can you tell us why do you want to add a Datatable as a Queue item. A Short Explanation of your process might confirm the Use of Serialization.

1 Like

What is serialization? and how to do that after reading data from data table

@rajat_dhammi You can Serialize the data to a json format and Convert it to a String, so that you can use transfer the String type data to the Queue instead of transferring a Datatable which is not possible. Then When you want to get the Datatable from the Queue you can Deserialize it back to a Datatable format. In this way transfer of different types of data to a Queue can be done.

Serialization:
strDT = NewtonSoft.Json.JsonConvert.SerializeObject(DT)

Deserialization:
DT = NewtonSoft.Json.JsonConvert.DeserializeObject(Of System.Data.DataTable)(strDT)

But i am using a Bulk Add queue items, to add excel data to queue.
and in Bulk add queue items, we have to provide data table, string variable will not work.

@rajat_dhammi If you use Bulk Add Queue Items Each row in Datatable will be added as a Queue Item. When you use Get Transaction Item to get the Queue Items You will get each row value and not the Whole Datatable. In case when you want the whole datatable to be retrieved at once from a Single Queue Item you can use Serialization method.

Apart from that it depends on what actually you are doing in the process.

i am just trying to add data on queue.
I used read range to read excel data and then used bulk add queue item to add that data to queue.
But i got the error Bulk Add Queue Items: Operation returned an invalid status code 'BadRequest’

Can you help in me in this?
I have earlier also used bulk add queue item , but this time its not happening

@rajat_dhammi Not Sure why that is happening, I tried and it worked. What does your Datatable contain? How many rows does it have ?

just this , nothing much

image

The ‘BadRequest’ means, that the Orchestrator is blocking the activity to add queue item, because it’s not meeting the criteria. This could have multiple reasons. For me it was solved by changing the Unique Reference settings, for the queue in the Orchestrator, from Yes to No, the error was solved.

Other points might be mentioned in this post:

1 Like