> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: getArrayItemsSelectedIndex()

## Article: getArrayItemsSelectedIndex()

## Article Link: https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/array-items/get-array-items-selected-index.md

## Article Content:

<!-- Source: packages/public-editor-platform-sdk/src/element/index.ts in wix-private/editor-platform -->
# getArrayItemsSelectedIndex()

Retrieves the currently selected index in an array data group on the selected component. An array data group is a `data` field with [`dataType: 'arrayItems'`](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/editor-react-components/manifest-reference/editor-element/data/data-types/complex-types.md) in the manifest, letting a Wix user manage a repeated set of items, such as a list of slides or testimonials.

## Syntax

```ts
function getArrayItemsSelectedIndex(
  options?: { arrayItemsDisplayGroupKey?: string }
): Promise<number>
```

## Parameters

| Name | Type | Description |
| :---- | :---- | :---- |
| `options.arrayItemsDisplayGroupKey` | string | Key of the array items display group to read from. Only required if the component's manifest declares more than one. |

## Returns

`Promise<number>`

Index of the currently selected array item.

## Example

```js
import { reactElements } from '@wix/editor';

const index = await reactElements.getArrayItemsSelectedIndex();
```

## See also

- [setArrayItemsSelectedIndex()](https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/array-items/set-array-items-selected-index.md)
- [resetArrayItemsSelectedIndex()](https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/array-items/reset-array-items-selected-index.md)
- [Complex Data Types](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/editor-react-components/manifest-reference/editor-element/data/data-types/complex-types.md)
- [About the React Elements API](https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/introduction.md)