---
name: "BIS_fnc_setNestedElement"
type: function
status: ok
groups: ["Arrays"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_setNestedElement
revid: 324401
updated: 2022-07-01T12:00:57Z
---

# BIS_fnc_setNestedElement

*Function · Arrays · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Function to set an item in a nested array using a path. Modifies the array by reference.

## Syntax

```sqf
[array, path, value] call BIS_fnc_setNestedElement
```

**Parameters:**

- `array`: [Array](../topics/Array.md)
- `path`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s
- `value`: [Anything](../topics/Anything.md)

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md) on success, [false](../commands/false.md) on failure

## Examples

### Example 1

```sqf
private _array = [[1, 2], [3, 4]];
_bool = [_array, [0, 0], 0] call BIS_fnc_setNestedElement; // _array is now [[0, 2], [3, 4]]
```

## See also

[BIS_fnc_findNestedElement](../functions/BIS_fnc_findNestedElement.md) · [BIS_fnc_findAllNestedElements](../functions/BIS_fnc_findAllNestedElements.md) · [BIS_fnc_removeNestedElement](../functions/BIS_fnc_removeNestedElement.md) · [BIS_fnc_returnNestedElement](../functions/BIS_fnc_returnNestedElement.md)

<sub>Source: [BI Community Wiki — BIS fnc setNestedElement](https://community.bistudio.com/wiki/BIS_fnc_setNestedElement) (revision 324401).</sub>
