> 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/compare-collection.md).

# Compare Collection

## Description

The *Compare Collection* part allows an application to identify the differences between a collection and a comparison collection. The system outputs the results into two user-defined collections:

* Items present in the comparison collection but not in the original collection
* Items not present in the comparison collection but present in the original collection

## Use

This part can be used in a variety of applications; for example, a user can deploy this part to identify identify new items and end-user selects from a checklist compared to the end-user's original selection. The user can also apply the part to identify the common items across two collections; i.e., find the intersection of the data.

## Editor Fields

| Field Name                                          | Description                                                                                                                                                                                                                                                                                                                                                         | Type/Options | Optional/Mandatory |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------ |
| collection1                                         | This is the name of the original collection.                                                                                                                                                                                                                                                                                                                        | Data Object  | Mandatory          |
| collection2                                         | This is the name of the revised or comparison collection.                                                                                                                                                                                                                                                                                                           | Data Object  | Mandatory          |
| (Output) deleted items                              | This is the name of the collection into which the Compare Collection part will write those items that are present in collection1 but not present in collection2.                                                                                                                                                                                                    | Data Object  | Optional           |
| (Output) added items                                | This is the name of the collection into which the Compare Collection part will write those items present in collection2 but not present in collection1.                                                                                                                                                                                                             | Data Object  | Optional           |
| (Output) equal items                                | This is the name of the collection into which the Compare Collection part will write items that are the same in both collections.                                                                                                                                                                                                                                   | Data Object  | Optional           |
| <p>Compare on specific keys<br>(Release 8.1 on)</p> | <p>In case of complex collections (where each item has multiple objects/keys to compare), this field defines one or more keys to compare the collections on.<br>This parameter is used to compare collections only on the specified keys, and not the collection as a whole. The added, deleted and common outputs above are populated based on these keys only</p> | Text         | Optional           |

The original collection--collection1--contains the items A, B, C, and D. The revised list--collection2--contains items A and F. In this situation, the items would be in the following collections:

* collection1: A, B, C, D
* collection2: A, F
* deleted\_item: B, C, D
* new\_item: F
* equal\_item: A

## Example

For an example of how to use the Compare Collection part, download and import the [How-To Guide: Introduction to Collections](/release-9/example-gallery/how-to-guides/how-to-guide-introduction-to-collections.md) and review the *Compare* tab of this project.

For an example of how to use the same part with a complex collection, download and import the [How-To Guide: Querying Complex Collections](/release-9/example-gallery/how-to-guides/how-to-guide-query-collection.md) example project. Note that this project should only be used on LogicNets Release 8.1 on.


---

# 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/compare-collection.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.
