FIND

Returns the first element in the array for which the lambda returns true.

Syntax 

FIND(array, LAMBDA(item, [expr]))

Examples 

Example 1

Input

{
  "my_array": [
    {
      "animal": "bee",
      "type": "insect"
    },
    {
      "animal": "cat",
      "type": "mammal"
    },
    {
      "animal": "dog",
      "type": "mammal"
    }
  ]
}

Formula

FIND(my_array, LAMBDA(item, item.type = 'mammal'))

Output

{
  "animal": "cat",
  "type": "mammal"
}
Was this helpful?