Using Real Variables to Develop Assistant Logic

Gabby Chan
Gabby Chan
  • Updated

One of the limitations of flowcharts in conversational design is the use of stubs and static variables. These variables are essentially placeholders that represent the expected input or output, and are not tied to any real data or information. For example: 

  • Hi, {name}! How can I help you today?
  • Can I get your {email} and {id_number} to search for your profile?
  • Here are your account details: {details}

Flowcharts aren't dynamic, so it's hard to visualize what the conversation would look like if those stub variables were replaced by real data. It also doesn't encapsulate other details about the variable, such as its data type, allowed values, and other instances of the variable. 

Real Variables in Voiceflow

Voiceflow allows designers to work with real variables, which can be used to store and manipulate data throughout the conversation. Real variables are linked to specific values or data points, have built-in data validation rules to ensure correct data input, and can be used to create more dynamic and personalized conversational experiences.

  • Variables are a key element in condition steps to choose the right conversational flow in a decision tree. 
  • These variables can also be used to personalize the conversation and offer more relevant recommendations or suggestions.
  • Real variables can also be used to track user progress and history throughout the conversational interface. For example, designers can use variables to track which tasks or actions the user has completed, or which pieces of information they have provided. This can be useful for creating more complex conversational flows, such as multi-step tasks or applications that require input from the user at different stages.

Designers can easily create, modify, and access variables directly within the Voiceflow interface, without the need for complex programming or coding. This allows designers to focus on the design and user experience, rather than technical implementation details.

Creating and Setting Variables

There are two main basic methods to create and set a variable on the Voiceflow canvas: a set step and a capture step. 

Set Step

A set step is one of Voiceflow's logic steps, and its purpose is to assign a value to either an existing or new variable. Set steps are useful for when you want to map out specific flows when variables are set in a certain way. 

 

Capture step

Capture steps are one of the user input 'listen' steps on the Voiceflow canvas. They enable a Voiceflow assistant to directly assign the value of a user response to an entity. Variables and entities are both elements that store data; however, entities are more powerful than variables because they have built-in data types and optional allowed set of values.  

 

As you become more comfortable with Voiceflow features, you may also find these two more advanced features to further manage variables and entities. 

  • Personas: when designing and testing an assistant, it is often helpful to clearly define prominent user types and any associated variable(s) to each persona (for ex. {hair_color} = 'brown'). By creating multiple personas, you can share your assistant prototype to external user testers or test your assistant internally, and automatically set certain variables with specific values that pertain to the persona. Learn more about this process here
  • API step: if you want to set a variable to a value that must be queried from an external database, you can use an API step to retrieve the piece of data and set the variable to the queried value. In the below example, the API step queries a database url with a search parameter of the user's email, and the query returns with the corresponding user profile's data, which is then captured into a new variable user_profile. 

 

 

Was this article helpful?

1 out of 2 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.