HelperStable

Distinct

Removes duplicates from a typed collection, either by the complete object or by a combination of fields.

Typed collection
Distinct
Collection
Typed result

Vue d’ensemble

Removes duplicates from a typed collection, either by the complete object or by a combination of fields.

Exemple

Deduplicate a contact list by email, or keep the latest occurrence of a relationship for a business key.

Parameters 3

itemsRequisobject[]
Typed collection supplied by a binding. The concrete element type is preserved or unified in outputs.
fieldsOptionnelstring[]
Fields whose combination defines uniqueness. An empty list compares the complete object.
keepRequisenum
Occurrence retained when a key appears multiple times: first or last.

Outputs 1

itemsobject[]
Resulting collection with the same concrete element type as the source collection.

Behavior

Without fields, the complete object determines uniqueness. With fields, their value combination forms the key. keep selects whether to preserve the first or last occurrence.

Key point Collection operations preserve the data classification carried by their elements; filtering, sorting, or concatenating a list is not declassification.

Limits and responsibilities

  • Deduplication does not merge objects: only one occurrence is preserved.
  • Choose stable fields when collection results must be reproducible.