AND
returns true if the provided arguments all return logical true, otherwise it returns false. Everything except false is treated as true.
Function category: Logical​
AND(arg1, [arg2...])
AND
can take an arbitrary number of additional arguments.
Arguments | Description |
| Expression that can be interpreted as true or false (including numbers, strings, and arrays etc.). |
| Optional. Same restrictions as |
Let's say we're given two responses with the following fleet deployment information.
The first response has values given for three fleets.
{"company_a": {"deployments": {"fleet_1": true,"fleet_2": true,"fleet_3": true}}}
The second response has values for only one fleet while fleet_2
has a null
value.
{"company_b": {"deployments": {"fleet_1": 1,"fleet_2": null}}}
If we want to determine if deployments are completed, use the following function.
# If deployments are completed, return trueAND(company_a.deployments.fleet_1,company_a.deployments.fleet_2,company_a.deployments.fleet_3)​# Returns true
We can also interpolate different kinds of "truthy" results.
# If deployments are completed, return trueAND(company_a.deployments.fleet_1,company_b.deployments.fleet_1)​# Returns true
# If deployments are compleed, return trueAND(company_a.deployments.fleet_1,company_b.deployments.fleet_2)​# Returns false