Unique In List
Creates a duplicate-free version of a list in which only the first occurrence of each element is kept
Description
Creates a duplicate-free version of a list in which only the first occurrence of each element is kept. The order of the result values is determined by the order they occur in the list.
The difference from the Filter List Distinct
brick is that the elements of the source shouldn't necessary be Cloud Objects to be filtered.
The brick is supposed to be used search in a list of primitive types (like strings, number,s booleans, and Cloud Objects).
If you need to filter a collection of non-primitive types (e.g. objects), we recommend using the Unique In List With Predicate
brick. This way a complex condition could be defined.
Example:
-
inputs
- source =
[2, 1, 2]
- source =
-
outputs
- result =
[2, 1]
- result =
Inputs
- Source (Object): The collection to inspect. Could be in the form of List, Array and QueryResult
Outputs
- Result (Object): A new duplicate free list
- Error Flow (Error Flow): Triggered by providing unexpected type of the source