Skip to content

Array Operations

The Array Operations node transforms input arrays through operations like filtering, projection, ordering, counting, and aggregation. It works with both simple arrays and arrays of objects, making it a flexible tool for preparing and manipulating list data.


Dependencies

No external service or node dependencies are required for this node.


Operations

OperationDescription
FirstReturns the first item in the array.
LastReturns the last item in the array.
WhereFilters the array where a specific property equals a given value.
SelectProjects a list of values from a specific property in each object.
DistinctRemoves duplicates from the array.
DistinctByRemoves duplicates based on a specific property’s value.
CountReturns the number of items in the array.
SkipSkips a specified number of items from the beginning of the array.
TakeTakes a specified number of items from the start of the array.
OrderByOrders the array ascendingly based on a property’s value.
OrderByDescendingOrders the array descendingly based on a property’s value.

Input Fields

LabelInput TypeDescriptionRequiredVisible WhenDefaultExample
Input ArraytextThe array of values or objects to be manipulated.✅ YesAlwaysNull{usersArray}
OperationpicklistThe operation to perform on the input array. See supported options below.✅ YesAlwaysNullWhere
Property NametextThe name of the property to be used for filtering, selecting, or ordering.⚠️ When VisibleWhen operation is Where, Select, OrderBy, OrderByDescending, DistinctByNull"Department"
ValuetextThe expected value of a property to use in a Where operation.⚠️ When VisibleWhen Operation is WhereNull"Engineering"
Skip CounttextNumber of items to skip from the beginning of the array.⚠️ When VisibleWhen Operation is SkipNull"2"
Take CounttextNumber of items to take from the start of the array.⚠️ When VisibleWhen Operation is TakeNull"4"

Output

The result of the selected operation is stored in the specified Output Variable Name. This can be referenced by downstream nodes using {VariableName} syntax.


Examples

First – Returns the first item in the array.

Selects the first value from the Input Array.

FieldValue
Input Array{{usersArray}} = [John, Cameron, Linda]
OperationFirst
OutputJohn
Last – Returns the last item in the array.

Selects the last value from the Input Array.

FieldValue
Input Array{{usersArray}} = [John, Cameron, Linda]
OperationLast
OutputLinda
Where – Filters the array where a property equals a given value.

Filters users by Role = Admin.

FieldValue
Input Array{{usersDict}} = [{Name: John, Role: User}, {Name: Cameron, Role: Admin}]
OperationWhere
Property NameRole
ValueAdmin
Output[{Name: Cameron, Role: Admin}]
Select – Projects values from a property in each object.

Selects all user names from the array.

FieldValue
Input Array{{namesArray}} = [{Name: John}, {Name: Cameron}, {Name: Linda}]
OperationSelect
Property NameName
Output[John, Cameron, Linda]
Distinct – Removes duplicates from the array.

Removes duplicate values.

FieldValue
Input Array{{lettersArray}} = [A, A, B, C, B]
OperationDistinct
Output[A, B, C]
DistinctBy – Removes duplicates based on a property’s value.

Removes duplicate objects based on the City property.

FieldValue
Input Array{{CitiesArray}} = [{City: NY}, {City: LA}, {City: NY}]
OperationDistinctBy
Property NameCity
Output[{City: NY}, {City: LA}]
Count – Returns the number of items in the array.

Counts how many users are in the array.

FieldValue
Input Array{{usersArray}} = [John, Cameron, Linda]
OperationCount
Output3
Skip – Skips a number of items from the beginning.

Skips the first 2 users.

FieldValue
Input Array{{usersArray}} = [John, Cameron, Linda, Sarah]
OperationSkip
Skip Count2
Output[Linda, Sarah]
Take – Takes a number of items from the beginning.

Takes the first 2 users.

FieldValue
Input Array{{usersArray}} = [John, Cameron, Linda, Sarah]
OperationTake
Take Count2
Output[John, Cameron]
OrderBy – Orders the array ascending by a property.

Sorts users by Age ascending.

FieldValue
Input Array{{userDetailsArray}} = [{Name: John, Age: 30}, {Name: Linda, Age: 25}]
OperationOrderBy
Property NameAge
Output[{Name: Linda, Age: 25}, {Name: John, Age: 30}]
OrderByDescending – Orders the array descending by a property.

Sorts users by Age descending.

FieldValue
Input Array{{userDetailsArray}} = [{Name: John, Age: 30}, {Name: Linda, Age: 25}]
OperationOrderByDescending
Property NameAge
Output[{Name: John, Age: 30}, {Name: Linda, Age: 25}]

Potential Errors

Error ConditionDescription
Required Parameters 'Parameter Name' not foundA required node parameter field has been left blank
Unhandled Error: Unable to cast object of typeInvalid type has been provided in a node parameter field, a previously generated {variable}

Developer Notes

  • When working with objects, arrays should be structured as key–value pairs (like { "Name": "John", "Role": "Admin" }) so property-based operations (e.g., Where, Select) can work.

Tentech 2024