IF

IF returns one value if true, and another if false; both are provided by arguments.

Function category: Logical

Syntax

IF(arg1, arg2, arg3)

Arguments

Description

arg1

Condition that returns a value that can be interpreted as true or false.

arg2

Value returned when arg1 evaluates to true.

arg3

Value returned when arg1 evaluates to false.

Example

Let's say we're given a response with the following fleet deployment information:

{
"company_a":{
"deployed":true
}
}

If we want to yield responses dependent on fleet deployment, we can use IF:

IF(company_a.deployed = TRUE, "Deployed and ready!", "Not deployed, not ready")

Because arg1 resolves to TRUE, this will return the following:

"Deployed and ready!"