How can I use variables in my designs?
Use variables in your designs to track and manage user provided information (dialogue variables) and to direct the conversation based on unspoken contextual information (context variables).
What is a dialogue variable and how do I use it?
A dialogue variable allows you to capture spoken or written data from the user during the conversation. It functions similarly to an entity. Each dialogue variable has a type that defines the type of information it can contain. You can use a built-in type or create a custom one.
To add a new dialogue variable:
Click into a User step
Use the # and begin typing your desired variable name
Click Add dialogue variable
You can choose a pre-existing variable type or create a new one and add custom values if applicable
If you'd like to define a new type with custom values, you can also select Allow values that are not defined to allow the user to input values that are outside of the ones you have specified. This can be useful while testing your design to make sure that the test doesn't get derailed if the user inputs a variable value that you haven't defined yet.Tip: Use AI-Companion
Use our AI-companion built with GPT-3 to automatically generate variable values. Simply click auto-generate next to the add value button.
When you are finished, click Add variable
Other ways to add dialogue variables:
You can also add new dialogue variables while creating a Condition step.
You can also add new dialogue variables in the project library
What is a context variable and how do I use it?
A context variable allows you to define how external information can influence the conversation. This can include anything from the time of day or the type of user to whether or not they have opened a car door. You can define any context that is useful to your assistant, the sky's the limit.
Context variables do not connect to any specific platform or assistant type so you have the flexibility to define them in whatever way makes sense to you - it's just a variable with values. While we do not connect your variables to any technical system, you can add a data source to your variable to annotate where you expect the information to come from to make design-dev collaboration easy.
To add a new dialogue variable:
Open the project library
Click on the context variable tab
Click + Add context variable
Click on "Untitled Context Variable" to add your variable's name
Select a data source from the drop down based on where you expect the information to come from
Select a variable type. You can use a built-in type, a custom type that already exists, or create a new type. Context variables share custom types with dialogue variables so that you can use any variable type with any variable.
This can be helpful when you want to transfer information from a dialogue variable to a context variable using the Set Variable step (coming soon).Select a data source from the drop down based on where you expect the information to come from
You can also add new context variables while creating a Condition step.
Referencing variables in Assistant steps
You can have the assistant verbally refer to the value of a dialogue or context variable in any response by typing it in the step using the # command.
To add a new dialogue variable: