If, Elseif, and Else Elements

Use

The if element specifies conditional statements that allow choosing different options based on, for example, variable values.

The else and elseif elements can be nested only in if elements, and they have no child elements.

Note: The application evaluates the condition in if and elseif elements when executing child elements in the if block. If you have multiple child elements in if or elseif elements, do not use conditions that can change during execution. For example, instead of using queue queries in a condition, use variables where you assign the value before an if block.

If

The if element can be nested in the following parent elements: error, timeout, block, filled, if, noinput, nomatch. The if element can have the following child elements: assign, audio, callout, clear, customstate, else, elseif, exit, goto, if, log, prompt, setlanguage, setprioroty, setskills, soap, var.

Note:

There must be at least one child element in the if element that defines what happens if the condition evaluates to true.

* = Specific to Sinch Contact Pro

Attributes for if Element

Description

Condition

Define the condition with a Python statement using one of the following options:

  • Use a ready-made condition:

    1. Select the condition from the drop-down list, they are indicated with Condition:.

    2. Select x (and y) from the drop-down list, or write the value, variable or Python statement.

    3. Click OK.

  • Choose a query, status, variable or other statement from the drop-down list, and complete the Python statement. For example, to make a condition that A-number must be 12345, choose a variable {ANUMBER} from the drop-down list and enter == "12345".

  • Enter the whole statement in Python code.

Description*

Enter a description of your element; what is it planned for, its requirements and limitations.

Elseif

The elseif element is used to specify additional conditional statements when proceeding conditional statements in an array evaluate to false. The application will execute the first conditional statement that evaluates to true.

Attributes for elseif Element

Description

Condition

Define the condition with a Python statement using one of the following options:

  • Use a ready-made condition:

    1. Select the condition from the drop-down list, they are indicated with Condition:.

    2. Select x (and y) from the drop-down list, or write the value, variable or Python statement.

    3. Click OK.

  • Choose a query, status, variable or other statement from the drop-down list, and complete the Python statement. For example, to make a condition that A-number must be 12345, choose a variable {ANUMBER} from the drop-down list and enter == "12345".

  • Enter the whole statement in Python code.

Description*

Enter a description of your element; what is it planned for, its requirements and limitations.

Else

The else element is used as the final logic constructor in an array of conditional statements, such as if and elseif elements, and its content is executed when all earlier conditional statements evaluate to false.

Attributes for else Element

Description

Description*

Enter a description of your element; what is it planned for, its requirements and limitations.

Example

Form the array of conditional statements in the following way:

  • Add the block element

    • Add the if element

      • Add the elseif elements for additional alternative conditions.

      • Add the else element for situations when none of the proceeding conditions is not true.