---
schema_version: "1"
id: 7c82bee9ff5d08e2f225d3772dfea73d380e31b7e3ea089c0df5f5a38476934b
title: ARRAY_POSITION
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/array-func/array-position.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-position.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1eda8e29e88e2a8abb214a8d03a34670cfc1c2e0e346cd2eca6f6b1565b08d07
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `ARRAY_POSITION`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the position of the first occurrence of a specified value in an array.

## Syntax

```sql
array_position(<array>, <value>)
```

## Arguments

### Required

- `<array>`: The array to search.
- `<value>`: The value to find (must match the array element type).

## Returns

Returns an integer that represents the 1-based index of the first occurrence, or NULL if the value isn't found.

## Considerations

- Returns NULL when the value isn't found.
- Position indexing is 1-based.

## Examples

### Find Element Position

Find the position of a value in an array.

```sql
SELECT array_position(array[1, 3, 4, 3], 3) AS position;
```

Returns `2`, the index of the first occurrence of 3 in the array.

### Value Not Found

Attempt to find a value that doesn't exist.

```sql
SELECT array_position(array[1, 3, 4, 3], 2) AS position;
```

Returns `null` because 2 isn't present in the array.

## Related Documentation

- [Array Data Type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/array.md)
