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 · 4 revisions

The OR Function

Function Group: Logical

OR returns true if any provided arguments return logical true, otherwise it returns false. Everything except FALSE is treated as true.

Syntax

OR(arg1, [arg2...])

  • arg1 is an expression that can be interpreted as true or false (including numbers, strings, and arrays etc.)
  • arg2 is optional, and has the same restrictions as arg1
  • OR can take an arbitrary number of additional arguments as well

Uses

Let's say we're given a response with some fleet deployment information that looks like this, with the api returning no data for the fleet_3 element:

{  
   "data":{  
      "fleet_ready":{  
         "fleet_1":true,
         "fleet_2":false,
         "fleet_3":null
      }
   }
}

If we want to determine whether any fleets are ready to deploy, we can use OR:

OR(data.fleet_ready.fleet_1, data.fleet_ready.fleet_2, data.fleet_ready.fleet_3)

This would return true.

Other Examples

OR(data.fleet_ready.fleet_1, data.fleet_ready.fleet_2) => true

OR(data.fleet_ready.fleet_1, data.fleet_ready.fleet_3) => true

OR(data.fleet_ready.fleet_2, data.fleet_ready.fleet_3) => false

Clone this wiki locally