Return to resources

Advanced design tools

Learn how to make the most of your VoiceXD superpowers

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:

  1. Click into a User step

  2. Use the # and begin typing your desired variable name

  3. Click Add dialogue variable

  4. 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.

  5. 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:

  1. Open the project library

  2. Click on the context variable tab

  3. Click + Add context variable

  4. Click on "Untitled Context Variable" to add your variable's name

  5. Select a data source from the drop down based on where you expect the information to come from

  6. 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).

  7. 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:

What are conditions and how do I use them?

For both dialogue and context variables, you can use the Condition step to define parameters for your variables in order to continue down a particular conversation path.

How and where do I add conditions?

You can add a Condition step between any User and Assistant step or between two Assistant steps

To add a condition:

  1. Click the + button between any User and Assistant step or between two Assistant steps

  2. Select Condition {} in the drop down and choose a dialogue or context variable to add. You can also choose to create a new variable.

Within the Condition step, you can use the dropdown next to any variable to select what kind of parameters you want to set.

Tip: Use Any value and No value

Assigning a variable to "Any-value" sets the condition to look for any valid value for the variable rather than a specific one. Assigning "No-value" sets the condition to look for no valid value being given for a particular variable.

How do I add and remove variables from my condition?

To add a new variable to your condition:

  1. Click the + Add condition button

  2. Choose whether you'd like to add a single condition or a create a new condition group. A condition group creates a sub group of conditions to be evaluated in isolation from higher level conditions and allows you to model more complex scenarios

To remove a variable use the trash icon next to any variable or condition group

Removing all variables from a condition will automatically delete the Condition step.

What are branches?

Branches allow you to create new flows in the conversation based on variations in what the user might say or specific variable conditions.

How do I add branches?

Branches can be added before Condition steps if you'd like to create an alternate path based on different values for your dialogue and context variables.

Branches can be also added before User steps if you'd like to handle different possible inputs from the user.

How do I remove branches?

You can remove any branch by removing the User or Condition step at the beginning of the branch. When you delete a branch, all sub branches contained within the corresponding branch will also be deleted. Similarly, if you delete a User or Condition step in the default branch, any sub branches connected to that step will also be removed.

What are branch connections and how do I use them?

Branch connections allow you to connect the end of a branch to a node in the other branch. This is allows you to re-use existing paths within your conversation rather than writing out an entirely new flow every time you create a branch.

To connect the end of a branch to a another branch:

  1. Click the + button after the last step in the branch

  2. Select the type of step you would like to connect to

  3. Click on the appropriate step in the branch you want to connect to

How do I manually set variable values?

You can add the "Set Variable" step after any step. The set variable step allow you to set any variable to a specific value, no-value, any-value, or to the value of another variable with the same type.