How to add and get complex data types while working with Queues

How to add complex datatypes in Queues and how to get complex datatypes from Queues?

Add to queue:

  1. In Studio, import Newtonsoft.Json namespace

  2.  Serialize datatable using the following command (output string): JSONConvert.SerializeObject(dt)

  3. Send the string to queue

Consume queue:

  1. Get the string from queue

  2. Use Deserialize json activity (from Uipath.Web.Activities package) using TypeArgument DataTable property

  3. Use the outputed datatable for your workflow.

Example: Sample workflow to add datatable to queue and retrieve the same. Please note this workflow is being created in UiPath Studio version 2019.4.3. Hence, it can be opened with version 2019.4.3 or higher. 
 Click here to download