Collection to Datatable

Estimated reading: 2 minutes 114 views

This activity allows users to convert collection values into a structured DataTable format, which cannot be achieved directly through syntax.

Properties

INPUT

Collection: * Specifies the existing collection variable to convert, using the ICollection<Object> data type. Refer to the documentation below for instructions on converting to an ICollection<Object> type.

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”
True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

OUTPUT

Datatable: *Returns the output of the activity as a table format in datatable variable.   

Result: This parameter allows you to view the execution status of the activity and returns a value in “Boolean.”

True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown

* Represents mandatory fields to execute the workflow.

Limitations

1. Only a single collection can be converted to a DataTable.
2. If the collection contains nested collections (e.g., a list of lists), the Collection to DataTable activity cannot convert it directly into a DataTable.

Steps to Convert to ICollection<Object> Data Type

This activity accepts input collections only in the ICollection<Object> data type. To convert an existing collection, you can either provide the conversion syntax directly in the “Collection” properties or use an Assign activity.

Option 1: Using syntax in the property field

“collectionVariable.Cast(Of Object)().ToList()”

Option 2: Using Assign activity

Using Assign activity: 

1. Drag and drop an Assign.
2. Create a variable with the ICollection<Object> data type.
3. In the To field, enter the created variable.
4. In the Value field, use the syntax “collectionVariable.Cast(Of Object)().ToList()”.
a. Here, collectionVariable refers to your existing collection variable.

Share this Doc

Collection to Datatable

Or copy link

CONTENTS