1. Docs
  2. Formulas
  3. Functions

ANY

Returns TRUE if the lambda returns a truthy value for at least one element in the array, otherwise returns FALSE. Only FALSE and NULL are falsy. An empty array returns FALSE.

Categories: Lambdas, Arrays

Syntax

ANY(array, LAMBDA(item, expr))

Examples

Example 1

Input

1
{
2
"my_action": {
3
"alerts": [
4
{
5
"name": "Failed login",
6
"severity": "low"
7
},
8
{
9
"name": "Malware detected",
10
"severity": "critical"
11
}
12
]
13
}
14
}

Formula

ANY(my_action.alerts, LAMBDA(alert, alert.severity = "critical"))

Output

true

Example 2

Input

1
{
2
"my_action": {
3
"alerts": [
4
{
5
"name": "Failed login",
6
"severity": "low"
7
},
8
{
9
"name": "Malware detected",
10
"severity": "medium"
11
}
12
]
13
}
14
}

Formula

ANY(my_action.alerts, LAMBDA(alert, alert.severity = "critical"))

Output

false

Example 3: An empty array returns FALSE.

Input

1
{
2
"my_action": {
3
"alerts": []
4
}
5
}

Formula

ANY(my_action.alerts, LAMBDA(alert, alert.severity = "critical"))

Output

false
Was this helpful?