Powered By GitBook
IS_IN_ARRAY_BY_KEY
Is the given item (identified by a key-value pair) in the target list?

Description

Given an list of objects, the name of a key present in the objects, and a value to match, returns true if a matching item is found in the list, or false if it is not.

Function signature

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

Examples

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