Last updated December 29th, 2018

What you'll learn

  • What IF blocks are, and how they work
  • When and how to use IF blocks

Video Tutorial:

What is an IF block?

The IF block acts as a check to see if a value has met certain conditions or not. If it meets a condition, the skill will execute down the corresponding path.

Example #1

IF the variable {likes_dogs} = yes; take the user down path 1.
IF the variable {likes_dogs} != yes; take the user down the else path.

Example #2

IF the variable {likes_dogs} = yes, yea, or sure; take the user down path 1.
IF the variable {likes_dogs} != yes, yea, or sure; take the user down the else path.

How Does the IF Block Work?

Within the IF block you can create conditions. These conditions are numbered and will be evaluated in numerical order. You can create up to 20 different conditions within a single IF block.

Each IF statement you add has a number beside it which corresponds to the number on the IF block. The '1' Statement corresponds with the '1' port on the IF block.

If the condition we put in the #1 Statement is evaluated as true then the IF block will take the user down that path. If statement #1 is not true, then statement #2 will be evaluated next and so on. If there is no match after running through al the conditions then the user will be taken down the ELSE path.

Adding Conditions 

To add conditions to your If block, click the little blue circle to the right of the entry bar. A dropdown menu will appear and you can select what you need for your condition. If you wish to compare a variable, select 'Variable'.

In your condition, a value is a predefined value that can be either character(s) or number(s). You will type this value directly into the entry bar with 'Value' selected. Reference the screenshot below, (20 != 50 so this condition will evaluate as false).

Still have questions? Message our team using the blue chat bubble in the bottom right corner!

Did this answer your question?