Array Filters
Array filters manipulate the output of arrays.
first
Return the first element in the array.
Parameters
Parameter | Description |
---|---|
type (required) |
Must be first . |
Example
Note: input arrays are actually treated as multiple separate inputs so the following example is just for illustration.
input:
- foo
- bar
- baz
schema:
type: string
filter:
type: first
Outputs:
foo
join
Join array elements to a string
.
Parameters
Parameter | Description |
---|---|
type (required) |
Must be join . |
separator (required) |
Specifies a string to separate each pair of adjacent elements of the array. If it’s an empty string the elements are joined without any character in between them. |
Example
Note: input arrays are actually treated as multiple separate inputs so the following example is just for illustration.
input:
- foo
- bar
- baz
schema:
type: array
items:
type: string
filter:
type: join
separator: '-'
Outputs:
foo-bar-baz
last
Return the last element in the array.
Parameters
Parameter | Description |
---|---|
type (required) |
Must be last . |
Example
Note: input arrays are actually treated as multiple separate inputs so the following example is just for illustration.
input:
- foo
- bar
- baz
schema:
type: string
filter:
type: last
Outputs:
baz
pop
Remove the last element in the array.
Parameters
Parameter | Description |
---|---|
type (required) |
Must be pop . |
Example
Note: input arrays are actually treated as multiple separate inputs so the following example is just for illustration.
input:
- foo
- bar
- baz
schema:
type: string
filter:
type: pop
Outputs:
- foo
- bar
shift
Remove the first element in the array.
Parameters
Parameter | Description |
---|---|
type (required) |
Must be shift . |
Example
Note: input arrays are actually treated as multiple separate inputs so the following example is just for illustration.
input:
- foo
- bar
- baz
schema:
type: array
items:
type: string
filter:
type: shift
Outputs:
- bar
- baz