Skip to main content

cond

Execute a sequence of instructions depending on the value of a JavaScript condition.

Parameters

NameTypeDescription
whenstringThe JavaScript condition to act on. Required.
thenarraySequence of instructions to execute when the condition evaluates to true. Required.
elsearraySequence of instructions to execute when the condition evaluates to false. Required.

Variables

None

Examples

version: 1.0.0
sections:
main:
- cond:
- when: "vars.foo < 2"
then:
- hangup
- when: "'%{call.to}' == '+15551231234'"
then:
- execute: help
- when: "/hello/.test('vars.foo')"
then:
- execute: match
- else:
- goto: retry