Collection Functions
Collection Functions in FlowOn Logic are built-in utilities that operate on lists or collections. They handle tasks ranging from transformation to evaluation of elements based on specified criteria. These functions streamline the processing of data within collections, making tasks like filtering, aggregation, and projection more efficient and intuitive.
Collection Average
Returns the average of all the elements in a numbers collection.
CollectionAverage([Numbers])
| Parameter | Required | Type | Description |
|---|---|---|---|
| Numbers | Yes | Number List | The list of numbers to find their average. |
| Return value | Number | The result of adding the two numbers. |
- Example
CollectionAverage([33,5,12,76])
Result: 31.5
Collection Count
Counts the number of items in a collection.
CollectionCount([Inputs])
| Parameter | Required | Type | Description |
|---|---|---|---|
| Inputs | Yes | List | The list of numbers to find their average. |
| Return value | Number | The result of adding the two numbers. |
- Example
CollectionCount(["Math","Physics","Chemistry","French"])
Result: 4
Collection Maximum
Returns the item with the highest value in the collection.
CollectionMaximum([Numbers])
| Parameter | Required | Type | Description |
|---|---|---|---|
| Numbers | Yes | Number List | The list of numbers to find the maximum value between them. |
| Return value | Number | The result of adding the two numbers. |
- Example
CollectionMaximum([-12.4,43.5,11.8,7.4,55.8])
Result: 55.8
Collection Minimum
Returns the item with the lowest value in the collection.
CollectionMinimum([Numbers])
| Parameter | Required | Type | Description |
|---|---|---|---|
| Numbers | Yes | Number List | The list of numbers to find the minimum value between them. |
| Return value | Number | The result of adding the two numbers. |
- Example
CollectionMinimum([12.4,43.5,11.8,7.4,55.8])
Result: 7.4
Collection Sum
Returns the sum of all the elements in a numbers collection.
CollectionSum([Numbers])
| Parameter | Required | Type | Description |
|---|---|---|---|
| Numbers | Yes | Number List | The list of numbers to calculate their summation. |
| Return value | Number | The result of adding the two numbers. |
- Example
CollectionSum([22,6,11,5,9,11,32])
Result: 96
Projection
Projects elements of a collection into a new form. This operation transforms each element in a collection based on a specified projection function, resulting in a new collection with the transformed elements.
Project([Collection], ProjectionFunction)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Collection | Yes | Collection | The collection of elements to be projected. |
| ProjectionFunction | Yes | Function | A function that specifies how to transform each element in the collection. |
| Return value | Collection | A new collection containing the transformed |
Filter
Filters elements of a collection based on a specified predicate. Only elements that satisfy the predicate are included in the resulting collection.
Filter([Collection], Predicate)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Collection | Yes | Collection | The collection of elements to be filtered. |
| Predicate | Yes | Function | A function that tests each element for a condition. |
| Return value | Collection | A new collection containing only the elements that satisfy the predicate. |
What's Next
In this section, we've explored various collection functions in FlowOn logic and learned how to apply them effectively. In the next section, we'll delve into the FlowOn Logic Blocks, their different type, how they work and how can we utilize them effectively.