Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
Dan Gorman edited this page Nov 29, 2018 · 3 revisions

The IF Function

Function Group: Logical

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

Syntax

IF(arg1, arg2, arg3)

  • arg1 is a condition that returns a value that can be interpreted as true or false
  • arg2 is the value returned when arg1 evaluates to true
  • arg3 is the value returned when arg1 evaluates to false

Uses

Let's say we're given a response with some fleet deployment information that looks like this:

{  
   "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")

This will return "Deployed and ready!".

Clone this wiki locally