---
name: "BIS_fnc_findNestedElement"
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_findNestedElement
revid: 327731
updated: 2022-07-13T10:17:58Z
---

# BIS_fnc_findNestedElement

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

## Description

Function to find item in nested arrays and return a path to the first match.

> [!NOTE]
> **Arma 3:** In some cases [findIf](../commands/findIf.md) might be the better way of finding a nested element. It is a lot faster!

## Syntax

```sqf
[array, query] call BIS_fnc_findNestedElement
```

**Parameters:**

- `array`: [Array](../topics/Array.md) - array to explore
- `query`: [Anything](../topics/Anything.md) - wanted item

**Returns:** [Array](../topics/Array.md) of [Number](../topics/Number.md)s - path to the first occurence of *query*

## Examples

### Example 1

```sqf
private _array = [[1, 2], [3, 4]];
_path = [_array, 3] call BIS_fnc_findNestedElement; // expected result: [1, 0]
// ((_array select 1) select 0) == 3
```

## See also

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

<sub>Source: [BI Community Wiki — BIS fnc findNestedElement](https://community.bistudio.com/wiki/BIS_fnc_findNestedElement) (revision 327731).</sub>
