Remove Duplicates
Removes repeated items from a list. Items can be compared as a whole or by selected fields only, and you choose whether the first or the last occurrence survives. The original order is preserved.
Parameters
| Name | Required | Default | Description |
|---|---|---|---|
Items (input) | Yes | — | The array to de-duplicate, e.g. {{ $nodes['Get Contacts'].items }}. |
Compare (compare) | No | All fields | allFields compares whole items; selectedFields compares only Fields. |
Fields (fields) | When comparing selected fields | — | Comma- or newline-separated field paths, e.g. email, address.postcode. Two items are duplicates when all listed fields are equal. |
Keep (keep) | No | First occurrence | first or last occurrence of each duplicate. |
Case-sensitive (caseSensitive) | No | true | When off, Ada@Example.com and ada@example.com count as the same. |
Ports
| Port | Description |
|---|---|
main (input) | The step(s) Remove Duplicates runs after. |
output | { items, count, removed } |
Example
De-duplicate sign-ups by email, keeping the most recent one:
- Items:
{{ $nodes['Get Signups'].items }} - Compare: Selected fields
- Fields:
email - Keep: Last occurrence
- Case-sensitive: off
Input items:
[
{ "email": "ada@example.com", "plan": "free" },
{ "email": "alan@example.com", "plan": "free" },
{ "email": "ADA@example.com", "plan": "pro" }
]
Output:
{
"items": [
{ "email": "alan@example.com", "plan": "free" },
{ "email": "ADA@example.com", "plan": "pro" }
],
"count": 2,
"removed": 1
}
Notes
- Values compare by type: the number
1and the text"1"are different. - With All fields, objects are compared by their full JSON content.
- A missing field counts as
null, so items that all lack a field are duplicates of each other on that field. - Items must resolve to an array (a single value is a one-item list; an empty value an empty list). Stored files must be parsed first.