{"name":"BIS_fnc_getFromPairs","operator":null,"title":"BIS fnc getFromPairs","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_getFromPairs","revid":349332,"updated":"2023-11-08T14:53:28Z","groups":["Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.02"}],"since":{"game":"arma3","name":"Arma 3","version":"1.02"},"arma3_since":"1.02","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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.","syntaxes":[{"syntax":"[array, key, defaultValue] call BIS_fnc_getFromPairs","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array","optional":false,"default":null,"description":"array to search through","types":["Array"],"since":null,"text":"array: Array - array to search through"},{"name":"key","type":"String","optional":false,"default":null,"description":"key to search for","types":["String"],"since":null,"text":"key: String - key to search for"},{"name":"defaultValue","type":"Anything","optional":true,"default":"nil","description":"default return value if no match was found","types":["Anything"],"since":null,"text":"defaultValue: Anything - (Optional, default nil) default return value if no match was found"}],"returns":{"type":"Anything","types":["Anything"],"description":"value associated with the key.","text":"Anything - value associated with the key."}}],"examples":[{"text":"```sqf\n[[[\"apple\",3],[\"pear\",\"test\"]],\"pear\"] call BIS_fnc_getFromPairs; // Returns \"test\"\n```","code":["[[[\"apple\",3],[\"pear\",\"test\"]],\"pear\"] call BIS_fnc_getFromPairs; // Returns \"test\""]},{"text":"```sqf\n[[[\"apple\",3],[\"pear\",6]],\"pear\"] call BIS_fnc_getFromPairs; // Returns \"6\"\n```","code":["[[[\"apple\",3],[\"pear\",6]],\"pear\"] call BIS_fnc_getFromPairs; // Returns \"6\""]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["find","findIf","BIS_fnc_findInPairs","BIS_fnc_addToPairs","BIS_fnc_removeFromPairs","BIS_fnc_setToPairs"],"notes":[{"user":"Benargee","date":"2014-10-02T01:17:00Z","text":"BIS_fnc_findInPairs renamed to BIS_fnc_getFromPairs and now supports all variable types [Source](http://dev.arma3.com/post/spotrep-00011)"}],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Arrays","Functions","Introduced with Arma 3 version 1.02"],"docblock":null,"filled_from_docblock":[]}