1. Docs
  2. Formulas
  3. Functions

ALL

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

Categories: Lambdas, Arrays

Syntax

ALL(array, LAMBDA(item, expr))

Examples

Example 1

Input

1
{
2
"my_action": {
3
"checks": [
4
{
5
"name": "dns",
6
"passed": true
7
},
8
{
9
"name": "tls",
10
"passed": true
11
}
12
]
13
}
14
}

Formula

ALL(my_action.checks, LAMBDA(check, check.passed))

Output

true

Example 2

Input

1
{
2
"my_action": {
3
"checks": [
4
{
5
"name": "dns",
6
"passed": true
7
},
8
{
9
"name": "tls",
10
"passed": false
11
}
12
]
13
}
14
}

Formula

ALL(my_action.checks, LAMBDA(check, check.passed))

Output

false

Example 3: An empty array returns TRUE, so check SIZE as well if an empty array should not pass.

Input

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

Formula

ALL(my_action.checks, LAMBDA(check, check.passed))

Output

true
Was this helpful?