---
title: "array:pos — Position of first/last occurrence"
description: "iXML command array:pos: Position of first/last occurrence."
canonical_url: "https://www.zeyos.com/ixml/ref/array-pos"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/array-pos.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# array:pos — Position of first/last occurrence

ARRAY:POS finds the position of first or last occurrence of a value within an array and returns the key of the corresponding array item if applicable.

If the offset is negative it will start that many items from the end of the array.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Variable name |
| var_result | var |  | Result variable name |
| offset | int |  | Search offset |
| type | type | first | Measurement type |

#### Possible values
Possible values for `type`:
- first — First occurrence
- last — Last occurrence


### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var_result; type: n/a

### Examples

```xml
<array var="names">
	<item>Bill Gates</item>
	<item>Steve Jobs</item>
</array>

<output>
	<array:pos var="names">Steve Jobs</array:pos>
</output>

<!-- 1 -->
```
