Powered By GitBook
FIND_BY_KEY
Find an object in list by a key

Description

Finds an object in the given list by a key-value pair.
For example, given Key "id" and Value 123, will return the object in the list whose id property is 123, or null if such an object was not found.
If multiple matches exist, the first matching object is returned.

Function signature

1
FIND_BY_KEY(list: Array, key: String, value: ) => Object
Copied!
Parameter
Description
List
List to find object in
Key
Key whose value to match
Value
Value to match

Examples

1
array1 = [{"a":3},{"a":2}]
2
key = "a"
3
value = 2
4
array = [{"a":3},{"a":{"b":10}}]
5
objValue = {"b":10}
Copied!
Formula
Return value
FIND_BY_KEY(array1, key, value)
{"a":2}
FIND_BY_KEY(array, key, objValue)
{"a":{"b":10}}
Last modified 11mo ago
Export as PDF
Copy link