# Set Array Element

## Overview

![The Set Array Element Node.](https://4267723012-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOEts3pBau6LMamSYhGZp%2Fuploads%2Fgit-blob-d1d8ce9569fa14e667517f0c9049c9c6375f19df%2Fsetarrayelementupdatedimage.png?alt=media)

**Set Array Element** updates one or more elements in an **Array** to new values. For this, it receives the `Index` of the element to update and the `Value` to which it will be updated.

If the `Index` is out of range for the **Array**, it will extend the **Array** up to the `Index` and fill the newly created element/s with empty element/s of the data type **Any**.

[**Scope**](https://docs.incari.com/incari-studio/2022.2/overview#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The Set Array Element Node](https://4267723012-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOEts3pBau6LMamSYhGZp%2Fuploads%2Fgit-blob-bc81892f9edb5b7e5cec64260ac0c6dc10518bfd%2Fsetarrayelementattributes.png?alt=media)

### Inputs

`Inputs` - The number of elements you wish to set the value of. Each **Input** element has the following **Attributes**:

| Attribute       | Type                                          | Description                                                                                                        |
| --------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `Index`         | **Int**                                       | The default `Index` of the element you wish to update if no value is provided in the `Index` **Input** **Socket**. |
| `Data Type`     | **Drop-down**                                 | The `Data Type` of the `Index` element you wish to update.                                                         |
| `Default Value` | *Defined in the* `Data Type` ***Attribute***. | The element whose `Index` is specified in the `Index` **Attribute** will be updated with this value.               |

## Inputs

| Input             | Type                                          | Description                                                                                                            |
| ----------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse**                                     | A standard **Input Pulse**, to trigger the execution of the **Node**.                                                  |
| `Array`           | **Array**                                     | An **Array** whose element/s you wish to update.                                                                       |
| `Index [n]`       | **Int**                                       | The `Index` of the element you wish to update.                                                                         |
| `Value [n]`       | *Defined in the* `Data Type` ***Attribute***. | An **Input** value that is used to replace the element whose *index* is specified in the `Index` **Input** **Socket**. |

## Outputs

| Output             | Type      | Description                                                                                                                            |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse** | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `Array`            | **Array** | An **Output** **Array** whose element/s have been replaced with the desired values.                                                    |

## Example Usage

![The Set Array Element Node Usage.](https://4267723012-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOEts3pBau6LMamSYhGZp%2Fuploads%2Fgit-blob-ab50d554971483b2aaca9df86c46dc8e78c09490%2Fset-array-usage.png?alt=media)

## See Also

* [**Array Value**](https://docs.incari.com/incari-studio/2022.2/toolbox/array/array-value)
* [**Pop Array Element**](https://docs.incari.com/incari-studio/2022.2/toolbox/array/pop-array-element)
