Powered By GitBook
FIND_BY_REGEX
Find an object in list by matching a key value with a regex pattern

Description

Finds an object in the given list by comparing the value of each object's Key property with the given regex.
For example, given Key "name" and Value Agnus, will return the object in the list whose name property contains Agnus, or null if such an object was not found.
If multiple matches exist, the first matching object is returned.

Function signature

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

Examples

1
array = [{"a":"abar"},{"a":"bar"},{"a":"foo bar"},{"a":1}]
Copied!
Formula
Return value
FIND_BY_REGEX(array, "a", "^foo")
{"a":"foo bar"}
Last modified 11mo ago
Export as PDF
Copy link