How to add data table/collection in queue

Gurus,

Does any one know how we can add data table or dictionary in bot queue using add queue item activity. I tried to find you tube video and knowledge base also but no help. Also tired my luck on existing topics in this forum but did not find any.

Whenever i tried to add data table to queue it gives error “could not determine JSON object type for type System.Data.DataTable”.

Also is there any way i can add whole excel tab as one single collection in queue.

Regards,
Varun

4 Likes

Does anybody had similar situation where collection or data table needs to be part or queue item.

Thanks & Regards
Varun

2 Likes

Usually each row is a separate transaction, so this is quite unusual. But if you have a valid reason there are options:

  1. Store file location instead.
  2. Serialize yourself. Import namespace Newtonsoft.Json, then use JsonConvert.SerializeObject(yourObject) to make it a string and store that. When getting object from queue use JsonConvert.DeserializeObject(Of DataTable)(queueItem.SpecificData(howyounamedit))
2 Likes

Please check your ID has write permissions on the database.
also make sure your query has all accurate columns/row names before updating the data into data table.

Hello,

I too have a similar issue, let me know if you got solution for this.

Thanks,
Megharaj Yadravi

Currently I have same problem.

System error at initialization: Could not determine JSON object type for type System.Data.DataTable. at Source: Newtonsoft.Json

Could someone suggest me, please?

1 Like

Hello,

You can convert the data-table to JSON string and add to queue and later De-serialise the string and use in the flow.

Thanks,
Meg

1 Like

@megharajky, thank you very much.
I re-search again and got your solution How to add a System.Data.DataRow variable into a work queue?

1 Like

Hello, @megharajky
How do I Deserialize the string when I get it back from the Queue, Can you give me an example? or Explain it, please.
Thanks

1 Like

Hello,

You can find the example xaml here.

Thanks,
Meg

@megharajky

good morning
at the time of converting it back to a data table, it only has one value and not all the values as if it were a table, how could that be solved?
Thanks a lot

You can take it as a datarow. Or you can gather all the transactions and make it datatable as describe in above post (attached example).
If you are confused/stuck please send some smple data i Will send the code for that.

1 Like