---
name: "BIS_fnc_setToPairs"
type: function
status: ok
groups: ["Arrays"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_setToPairs
revid: 349084
updated: 2023-11-08T14:47:24Z
---

# BIS_fnc_setToPairs

*Function · Arrays · Arma 3 v1.00*

## Description

Works similar to the [BIS_fnc_addToPairs](../functions/BIS_fnc_addToPairs.md) but it doesn't try to add values. It just overwrites the volue if the key already exists.

## Syntax

```sqf
[array, key, newValue] call BIS_fnc_setToPairs
```

**Parameters:**

- `array`: [Array](../topics/Array.md) - array to search through
- `key`: [String](../topics/String.md) - key to search for
- `newValue`: [Anything](../topics/Anything.md) - (Optional, default 1) new value set if match was found

**Returns:** [Array](../topics/Array.md) - resulting modified array

## Examples

### Example 1

```sqf
[[["apple",3],["pear",2]],"pear",10] call BIS_fnc_setToPairs; // Returns [["apple",3],["pear",10]]
```

## See also

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

<sub>Source: [BI Community Wiki — BIS fnc setToPairs](https://community.bistudio.com/wiki/BIS_fnc_setToPairs) (revision 349084).</sub>
