Introduction to Variables & Logic

Tahsim Ahmed
Tahsim Ahmed
  • Updated

What are Variables? What is logic?

Just like in any digital experience, in order to create personalized, high-fidelity or complex/engaging custom conversational designs, it is crucial to be able to and leverage Logic, Variables and Conditions and associated functionalities. 

Tip: If you have a grasp on these terms, you can skip to the specific sections of the Logic section which cover Voiceflow Logic Steps. If you're new to these terms and/or programming logic, please continue on.

Introduction to Variables

Variables can be contextualized as container(s) that allows them to have data/information stored inside of it, and to be able to be used elsewhere or recalled at a later time. In Voiceflow, the importance of variables can be seen in this simple exercise.

Ex. Let's say you want to personalize your conversational assistant by the user's name. The below screenshot outlines one introductory method in order to do so:

Note that the above example is not entirely scaleable, and it would not be feasible to remember every user's name manually. Furthermore, the above example would only work if your user's name was actually Joe, and this would not be dynamic (or personalized).

Tip: For information you expect to get filled or can vary and there is a need to be contained, you will want to use variables

Here is the above example improved, with variables:

For educational purposes, you can quickly test & simulate and see this variables in-action!

Note: The below method replicates a use case of what the Set Step accomplishes, but the changes/variable declarations are only test-specific and unique for that specific design-test session and not in your assistant.

To do this, start with testing your experience by hitting the blue Run (shortcut R) button:

  • Navigate to Variables sidebar, when in Test mode under the Test Tool on Canvas
  • Set the value of your desired variable by inputting in the desired field in the Variables menu or setting your desired Variable State/Persona (testing with Variables).
  • You can then Run Test:
Tip: You can learn more about testing & prototyping with Variables and their state(s)in this doc here.

 

Was this article helpful?

8 out of 9 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.