Page tree
Skip to end of metadata
Go to start of metadata

In ACR Scheme we have the following conditional statements:

  • Use if ... then to specify a block of code to be executed, if a specified condition is true
  • Use else to specify a block of code to be executed, if the same condition is false
  • Use switch to specify many alternative blocks of code to be executed

IF

[
  {
    "if": {
      "expression": "${myVar} != ''",
      "then": [],
      "else": []
    }
  }
]
ObjectDescription
expression
The condition of if statements should always result in either true or false.
then
If the result is true, immediate then block would be executed.
else
If the result is false, immediate else block would be executed.

SWITCH

[
  {
    "switch": {
      "variable": "${IVR}",
      "case": {
        "1": [],
        "2": [],
        "3": [],
        "default": []
      }
    }
  }
]
ObjectDescription
variable
Variable for cases.
case

The value of the variable is compared with the values of each case.

default
The block of the applications that would be executed if the given value is not matched with any of the pre-defined values.