Get Array Value#
The Get Array Value converter receives an array and returns one element from it. The Position setting picks which element to return: the first, the last, or the element at the zero-based Index entered in the corresponding field.
Settings#
| Name | Data Type | Possible Values | Description |
|---|---|---|---|
| position | Enum | FirstLastIndex | Which element of the array to return |
| index | Integer | Zero-based index of the element to return when position is Index |
Table 1: Settings
Examples#
Assuming the input array ["First1111", "Second", "Third", "Fourth", "Fifth", "Last222"]:
position | index | Output |
|---|---|---|
First | N/A | "First1111" |
Last | N/A | "Last222" |
Index | 0 | "First1111" |
Index | 2 | "Third" |
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 | position | index | Result |
|---|---|---|---|
null | any | any | Fails with Cannot read properties of null (reading 'length'). |
| Any array | Index | (not set) | Fails with An Index must be defined when the Position is 'Index'. |
| Array of length 6 | Index | 6 | Fails with The input is not parsable with current configurations. Invalid index position 6. The value must be between 0 and 5. |
| Array of length 6 | Index | -1 | Fails with The input is not parsable with current configurations. Invalid index position -1. The value must be between 0 and 5. |
Table 3: Invalid Input
