Array Slice#
The arrayslice converter receives an array of any type and removes any position of the array that is not in the given interval. It receives a start position and a count input. The transformed array will be the original array from the position given by the start position input, until it has added the number of positions equal to the count input number. If count is 0 it will assume that count is the length of the array. It uses the javascript .slice() function.
Settings#
| Name | Data Type | Description |
|---|---|---|
| start | Integer | First position to include (0 means the first element of the array) |
| count | Integer | Number of positions to slice |
Table 1: Settings
Examples#
| Input array | start | count | Output |
|---|---|---|---|
[1, 2, 3, 4] | 1 | 3 | [2, 3, 4] |
[1, 2, 3, 4] | (default 0) | 1 | [1] |
[1, 2, 3, 4] | 2 | (not set) | [3, 4] |
Table 2: Examples
Invalid Input#
This converter fails in any of the cases below. For what happens to the rest of the chain when a converter fails (the error is logged, reported for monitoring, and the next task does not run), see Converters.
| Input array | start | count | Result |
|---|---|---|---|
[1, 2, 3, 4] | 4 | N/A | Fails: start is not within the array bounds. |
[1, 2, 3, 4] | 2 | 3 | Fails: start + count exceeds the array length. |
Table 3: Invalid Input
