How to serialize JSON file

I’m trying to pass a datatable into an Orchestrator queue. I’ve seen several posts that talk about using newtonsoft.json package to serialize but I can’t find that in the packages list. Can someone advise on where to find the package, a different package that would work or how else I can pass a datatable to a queue?

@Will_Tyler

For this, why you want to serialize JSON file. Read one by one datarow from DataTable and then use Add Queue Item activity and specify QueueName and ItemInformation fields etc…

@Will_Tyler Install UiPath.WebAPI.Activities

@Will_Tyler

stringVariable = Newtonsoft.Json.JsonConvert.SerializeObject(Datatable)

you can pass this string to the AddQueueItem as a string.

Import Newtonsoft.json namespace

1 Like

As I stated in my question, I’ve seen several posts that talk about using newtonsoft.json package to serialize but I can’t find that in the packages list to import. When I try to use the serialize command I get

Source: Add Queue Item

Message: Could not determine JSON object type for type System.Data.DataTable.

Exception Type: System.ArgumentException

I don’t have a package called UiPath.WebAPI.Activities. I have UiPath.Web.Activities installed but under my JSON list I only have deserialize.

The number of rows will change per transaction. I don’t want to fill up my TI with a large amount of blank fields.

Hi @Will_Tyler,

Please take a look at Bulk Add Queue Items. I think it will fit what you’re looking for.

My Orchestrator version doesn’t support this but I don’t think it’s what I’m looking for either. From what I can tell, if I had 5 rows in my datatable this would create 5 different transactions. I want all 5 rows in 1 transaction.