---
schema_version: "1"
id: c6fb1b057f250c66f61a3ecb4fb0b9255bbfda5c483c7507e2bcabf720f397bc
title: index
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-values-functions-index.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-values-functions-index
source_site: docs.mulesoft.com
content_type: documentation
content_hash: aebe148ed3ea919947388d676ae6a566176faee3292de67883384a21050daee9
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# index

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## index(Number): PathElement

This function creates a `PathElement` data type to use for selecting an _array element_ and
populates the type’s `selector` field with the specified index.

Some versions of the `update` and `mask` functions accept a `PathElement` as an argument.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>index</code></p></td><td><p>The index.</p></td></tr></tbody></table>

### Example

This example creates an selector for a specified index. It sets the selector’s value to `0`. In the
output, also note that the value of the `"kind"` key is `"Array"`.

#### Source

```DataWeave
 %dw 2.0
 output application/json
 import * from dw::util::Values
 ns ns0 http://acme.com/foo
 ---
 index(0)
```

#### Output

```Json
{
   "kind": "Array",
   "namespace": null,
   "selector": 0
 }
```
