Skip to main content
Version: v0.17.0

ArrayGroupBy

Alias:ArrayGroupBy, Group

Output:Array of Entity

Group elements in an array or entities in a stream using a function. Entities in the resulting array will have two properties Key and Values. The Key will be set according to the result of the function.

ParameterTypeRequiredPositionSummary
Arrayarray<T>✔1The array or entity stream to group
Function
By
Using
T✔2A function to use to group entities

Examples​

SCL​

Group Array: [
('type': 'A', 'value': 1)
('type': 'B', 'value': 2)
('type': 'A', 'value': 3)
] Using: (<item>['type'])

Expected Output​

[('Key': "A" 'Values': [('type': "A" 'value': 1), ('type': "A" 'value': 3)]), ('Key': "B" 'Values': [('type': "B" 'value': 2)])]