Merge Collections

Estimated reading: 2 minutes 115 views

This activity allows the user to merge two existing collections into a single collection variable.

Properties

INPUT

Collection: *Specifies to provide the first existing collection variable in “Icollection<Object>” datatype. Refer to the documentation below for instructions on converting to an ICollection<Object> type.

Second collection: *Specifies to provide the second existing collection variable. “Icollection<Object>” datatype. 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

Merged Collection: *Returns the output of the activity as the merged collections into one 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. Both input variables must be of the same data type. Throws exception if the two collections are of different data types.
a. Eg: Only String to String datatypes can be converted.

2. The activity merges all elements by default. If duplicate entries are not required, additional filtering logic should be applied after the merge.
a. After merge, if you need to filter any values, use filter collections

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” and “Second 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

Merge Collections

Or copy link

CONTENTS