I am trying to add rows of information extracted from an excel sheet and stored in a datatable into a work queue.
I am using a For Each Row Activity to loop through the data table and I have the Add Queue Item Activity within the body. I have setup a System.Data.DataRow argument within the Item Information section of the Add Queue Item Activity but I keep getting the following error message: “Could not determine JSON object type for type System.Data.DataRow”.
What is the correct method for adding DataRow variables into a work queue?
I think if the variable value doesn’t match then you will get the error like that. In my case for Set Transaction status i need to pass Get Queue Item output variable(System.Collections.Generic.IEnumerable<UiPath.Core.QueueItem>) , instead of that i passed Get Transaction Item Output Variable(UiPath.Core.QueueItem) then I also got the error like “Set Transaction Status: Could not determine JSON object type for type UiPath.Core.QueueItem.” After passing correct values i got the output.
I have passed the data row to queue by converting it into JSON string and later while retrieve transaction item I have converted JSON string to datarow,
It worked for me, if any info required let me know.
Could you please share your solution?
I have a similar case where DataRows should be added to the queue and retrieved. I have used JsonConvert.SerializeObject(row) in the AddQueueItem activity and looks like that’s working. What I’m struggling with is the deserialization part after GetQueueItem. Deserialize JSON activity fails with error: “Deserialize JSON: Unexpected character encountered while parsing value”
Hi Sir,
How to assign the JSONConvert.SerializeObject(MyDT) to Jsonstring in assign activity.if i need to download the any packages for this/or not. Can you please give me brief information on this. And the thanks for provided sample template.
This has been irking me for ages. I never got a decent answer that works.
The requirement is to start with a DataRow, not a DataTable.
For example using the REF, all you have in Process.xaml is the current row not a dataset/table.
Whether your sourcing from a spreadsheet, database, or queue its the same.
If you serialize a DataRow you get the whole damn table as a property because thats how .NET works.
So here is my offering as a solution : turn the DataRow into an Array and serialize that.