Insert data in queue with Bulk add Queue items error

Hello ,

I have an issue when trying to upload datatable to queue with Bulk Add Queue items activity , the error msg is “Operation returned an invalid status code ‘BadRequest’”
I guess the problem is with datatable size it contains +26k rows i had the idea to use for each but i didn’t know how to do it , maybe there is another solution any help please ?

Regards

Hi @Deep_HML

Check if the datatable column names contain any (.). If the column name contain any dot(.), it will give the same error. Else try add queue item activity in the for each row in datatable activity with different column names.

Regards,
@supriya117

@Deep_HML

To confirm…did you try with only onw row of data? …first try with it…it might be that the columns names are not exactly matching or so…check those…

And yes the limit is 15k or so…

We can break the table into rows of 10k and add in 3 loops

So use for loop with Enumerable.Range(0,Cint(Math.Ceiling(dt.RowCount/10000))).ToArray and change type argument to integer

And inside loop to get each chunk use dt.AsEnumerable.Skip(currentitem*10000).Take(10000).CopyToDataTable

And use the chunkdt to load the queue

Hope this helps

Cheers

1 Like

Hi @Deep_HML ,

Maybe also take a look at the below post :

1 Like

Hi @Deep_HML

Possible cause of this error could be due to the size of the data table you are trying to upload. If you try to upload each row as a queue item, it will take 7.2 hours even if you assume one row takes one second.

If you are sure that the datatable structure and colums are correct, you can split the table into batches & try uploading each batch. Try this query:

dt.AsEnumerable().Batch(1000))

Hope this helps,
Best Regards.

Hello,
I double checked the columns are all normal and its worked before when data size was less than 15k

Hello Anil,

I tried to do the for each but ‘Ceil’ is not declared i don’t know if it a fonction i need to upload or somth ??

Best Regards.

Hello @arjunsjenoy,

Yes am sure of the datatable , so i need to do this query inside of a loop ?

Best Regards.

@Deep_HML

Yes, inside the for each loop, upload each batch created.

Best Regards.

I did try but it seemed wrong the msg said that batch doesnt exists

@Deep_HML

Use math.ceiling in place of ceil

** Replace above as well **

Cheers

@Deep_HML

Change the activity TypeArgument to System.Data.Datatable, place a bulk queue upload activity inside the loop & pass item.ToArray()

Hope this helps,
Best Regards.

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