> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/platform-documentation/process-node-parts/merge-collections.md).

# 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                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Note that in this scenario the entry value "Tim" is duplicated<br>but will only occur ONCE in the result collection<br><img src="https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-e078b4bf9843c892396b7c334c191941d9a157e6%2Fb8051175-f5b1-4d63-a3ca-957dc019c768.jpg?alt=media" alt=""></p> |   | <p>In this scenario there are consistent key-value pairs, with no repeat on key of \[email]<br><img src="https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-645e864da046b2bf186defd4c0ffb9d7cc7cc750%2Fee07996c-38e1-483d-944b-d652fa6f9e75.jpg?alt=media" alt=""></p> |

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                  | <p>This part has two operation modes depending on the nature of the collection:<br>- <strong>Merge on entry-value</strong>: Merge the collections based on the entry value or one key of the entry.<br>- <strong>Merge on index</strong>: Merge the collection based on the number or alphanumeric indexes.</p> | Dropdown     | Optional           |
| Key                   | <p>For complex collections merge on the specified key:<br>(“Merge on entry-value” mode only)<br>Specify the key when necessary using 'merge on entry-value' above</p>                                                                                                                                           | Data Object  | Optional           |
| Merge entry values    | <p>(“Merge on entry-value” mode only)<br>Merge entry values when the entry exists in multiple collections</p>                                                                                                                                                                                                   | Dropdown     | Optional           |

## Examples

Download an [example project](/release-9/example-gallery/example-projects-for-parts/merge-collections-example-project.md) 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"}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/platform-documentation/process-node-parts/merge-collections.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
