# Transform array element
> Supported in: Batch, Streaming
Maps each element of an array using an expression. Note, array index starts at 1.
**Expression categories:** Array
## Declared arguments
* **Array:** Input array containing elements to apply the expression over.
*Expression\>*
* **Expression to apply:** The expression to apply once per element of the array.
*Expression\*
**Type variable bounds:** *T accepts AnyType*
**Output type:** *Array\*
## Examples
### Example 1: Base case
**Argument values:**
* **Array:** `flight_number`
* **Expression to apply:**
stringBeforeDelimiter(
delimiter: -,
expression: `element`,
ignoreCase: false,
)
| flight\_number | **Output** |
| ----- | ----- |
| \[ XB-134, MT-111 ] | \[ XB, MT ] |
***
### Example 2: Base case
**Argument values:**
* **Array:** `miles`
* **Expression to apply:**
add(
expressions: \[`previous_miles`, `element`],
)
| miles | previous\_miles | **Output** |
| ----- | ----- | ----- |
| \[ 12300, 12342 ] | 10000 | \[ 22300, 22342 ] |
***
### Example 3: Base case
**Description:** Add the index to the array element. Note the index starts at 1.
**Argument values:**
* **Array:** `array`
* **Expression to apply:**
add(
expressions: \[`elementIndex`, `element`],
)
| array | **Output** |
| ----- | ----- |
| \[ 1, 1, 1 ] | \[ 2, 3, 4 ] |
***
### Example 4: Base case
**Argument values:**
* **Array:** `miles`
* **Expression to apply:**
cast(
expression: `element`,
type: String,
)
| miles | **Output** |
| ----- | ----- |
| \[ 12300, 12342 ] | \[ 12300, 12342 ] |
***
### Example 5: Base case
**Description:** Getting the struct element from an array of structs.
**Argument values:**
* **Array:** `raw_data`
* **Expression to apply:**
getStructField(
locator: miles,
struct: `element`,
)
| raw\_data | **Output** |
| ----- | ----- |
| \[ {
**miles**: 22300,
**tail\_number**: XB-112,
}, {
**miles**: 22342,
**tail\_number**: XB-112,
} ] | \[ 22300, 22342 ] |
***
### Example 6: Base case
**Description:** Getting the struct element from an array of structs.
**Argument values:**
* **Array:** `raw_data`
* **Expression to apply:**
transformMapKeys(
expression:
uppercase(
expression: `key`,
),
map: `element`,
)
| raw\_data | **Output** |
| ----- | ----- |
| \[ {
miles -> 22300,
tail\_number -> XB-112,
}, {
miles -> 22342L,
tail\_number -> XB-112,
} ] | \[ {
MILES -> 22300,
TAIL\_NUMBER -> XB-112,
}, {
MILES -> 22342L,
TAIL\_NUMBER -> XB-112,
} ] |
***