Skip to main content

switch

Execute a sequence of instructions depending on which value matches a variable.

Parameters

NameTypeDescription
variablestringName of the variable whose value needs to be compared. Required.
caseobjectObject of values mapped to array of instructions to execute. Optional. Default is not set.
defaultarrayOptional array of instructions to execute if no cases match. Optional. Default is not set.

Variables

None

Examples

version: 1.0.0
sections:
main:
- switch:
variable: prompt_value
case:
1:
- goto: sales
2:
- play: "https://example.com/hello.wav"
default:
- play: "https://example.com/no_match.wav"