Merge Collections
Description
The merge collections part combines two or more collections into one, including numbered collections. The exact behavior of the merge depends on the parameters set, but some simple examples of the use of this part include the following:
- Combining two independent lists of US states derived from independent sources
- Merging two job roles for a single user to generate a single variable of all tasks for which the user has permission
Common Scenarios
1. To merge simple "lists", or to merge two complex collections that have the same sets key value pairs throughout but no overlap on the keys, enter the input and result collection names and choose "merge on entry-value" mode only (leave key and checkbox empty).
Simple List | Complex Collection | |
Note that in this scenario the entry value "Tim" is duplicated
|
In this scenario there are consistent key-value pairs, with no repeat on key of [email]
|
2. To merge complex collections that have at least ONE common dimension (key) but different key-value sets, enter the input and result collection names, choose merge on entry-value mode, enter the common dimension as the key and check merge on entry value.
For example, car part ID is a common dimension across collection of physical specifications (color, size, material) and supplier specifications (supplier_name, price, lead-time).
Other merge scenarios, including using indexed collections (instead of numbered collections as per the examples above) are less common but still possible using this part. Download and explore the sample project to see the different modes of operation and output possible.
Editor Fields
Field Name | Description | Type/Options | Mandatory/Optional |
Add collection object | This is the name of the first input collection. Use the + icon to add additional collections for merging. | Collection | Mandatory |
Result collection | This is the name of the collection to which the results are output. | Collection | Mandatory |
Mode | This part has two operation modes depending on the nature of the collection:
|
Dropdown | Optional |
Key | For complex collections merge on the specified key: (“Merge on entry-value” mode only) Specify the key when necessary using 'merge on entry-value' above |
Data Object | Optional |
Merge entry values | (“Merge on entry-value” mode only) Merge entry values when the entry exists in multiple collections |
Dropdown | Optional |
Examples
Download an example project and import into your Designer.
This is an example of merging two lists of US states that are/are not flagged for processing.
- Collection1 = {state="DC", flag = "No", state="CA", flag = "Yes"}
- Collection2 = {state="DC", flag = "No", state="FL", flag = "Yes"}
output_collection = {state="DC", flag = "No", state="CA", flag = "Yes", state="FL", flag = "Yes"}