---
name: "BIS_fnc_getFromPairs"
type: function
status: ok
groups: ["Arrays"]
arma3_since: "1.02"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_getFromPairs
revid: 349332
updated: 2023-11-08T14:53:28Z
---

# BIS_fnc_getFromPairs

*Function · Arrays · Arma 3 v1.02*

## Description

Searches the associative array for the 1st occurance of the key string and returns the value associated with it. Search is not case sensitiv.

## Syntax

```sqf
[array, key, defaultValue] call BIS_fnc_getFromPairs
```

**Parameters:**

- `array`: [Array](../topics/Array.md) - array to search through
- `key`: [String](../topics/String.md) - key to search for
- `defaultValue`: [Anything](../topics/Anything.md) - (Optional, default [nil](../commands/nil.md)) default return value if no match was found

**Returns:** [Anything](../topics/Anything.md) - value associated with the key.

## Examples

### Example 1

```sqf
[[["apple",3],["pear","test"]],"pear"] call BIS_fnc_getFromPairs; // Returns "test"
```

### Example 2

```sqf
[[["apple",3],["pear",6]],"pear"] call BIS_fnc_getFromPairs; // Returns "6"
```

## See also

[find](../commands/find.md) · [findIf](../commands/findIf.md) · [BIS_fnc_findInPairs](../functions/BIS_fnc_findInPairs.md) · [BIS_fnc_addToPairs](../functions/BIS_fnc_addToPairs.md) · [BIS_fnc_removeFromPairs](../functions/BIS_fnc_removeFromPairs.md) · [BIS_fnc_setToPairs](../functions/BIS_fnc_setToPairs.md)

## Community notes

**Benargee** — 2014-10-02

[BIS_fnc_findInPairs](../functions/BIS_fnc_findInPairs.md) renamed to [BIS_fnc_getFromPairs](../functions/BIS_fnc_getFromPairs.md) and now supports all variable types [Source](http://dev.arma3.com/post/spotrep-00011)

<sub>Source: [BI Community Wiki — BIS fnc getFromPairs](https://community.bistudio.com/wiki/BIS_fnc_getFromPairs) (revision 349332).</sub>
