I wanted to add 8 string variables, 2 data table variables in a single queue item.
Community please help/suggest.
Hi @mohit_RPA
Do you want to add if all in one queue?
For adding data from datatable, you can use add bulk queue items activity.
For adding single variables, you can use add queue item activity.
Thanks for the response @sonaliaggarwal47
The requirement here is to add 8 string variables and 2 data tables into 1 single transaction item/ Queue item
Hi @mohit_RPA
In that case you will need to run the loop on datatable and add items from a row individually along with other string variables and then in next iteration, other data rows gets added
you can concatinate your strings with some delimiter # or @ then you can convert your data tables to json and add those as well concatinating with other strings,
so to conclude ā
string1+string2+ā¦+String (json of datatable1)+String (json of datatable2)
you can convert the datatable tos tring using output datatable and add to queue
few things to bear in mind
- When you change to string or serialize when you retrieve you need to deserialize
- Also there is a limitation for queue item size and if datatable is big it might error out
cheers
Hi @mohit_RPA
You can definitely add multiple variables (strings & datatables) into one queue item, but you cannot store a DataTable directly in Orchestrator Queue Item because Queue Type is not allowed. But you must serialise it and store it. But when you can read back you need to deserialise and use it.
You can serilaise like :
dtJson = Newtonsoft.Json.JsonConvert.SerializeObject(YourDataTable)
you can deserialise like
dt1 = Newtonsoft.Json.JsonConvert.DeserializeObject(Of DataTable)(queueItem.SpecificContent(ādtJsonā).ToString)
Thank you community for the help, I am able to push the DataTable to a queue item by converting it into a JSON string. However, when I try to convert the JSON string back into a DataTable, I encounter an error that seems related to a blank row in the header, specifically for āUser Mobile Numberā.
To provide some context, I am sharing a sample input data. The business requirement is that each row may have a value under either the āUser Mobile Numberā column or the āUser Phone Numberā column. Both columns might contain values, or only one of them will have a non-blank value. Please suggest how to handle this scenario when deserializing the JSON string back into a DataTable.

Hi @mohit_RPA
This happens because DataTable columns auto-infer data types, and your āUser Mobile Numberā column contains: Eg : ā1111234566ā which is double.
It always good we convert all phone/mobile number columns to String before we serialize.
Use an Assign before serialization in for each loop in datatable
If col.ColumnName = āUser Mobile Numberā OrElse col.ColumnName = āUser Phone Numberā Then
Assign ā col.DataType = GetType(String)
Hope this will solve your issue.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
