Outputting string variable

Use a variable to store a string and then have it spoken in a speak block?

Welcome to Voiceflow. Yes you can use a variable to store a string and have it spoken in a speak block.

First, here is some information about how variables work in Voiceflow:

To accomplish, you would need to do the following:

  1. Declare a variable in the Variables panel (for example {whatAlexaSays1}
    2a. Use a Set block to add the text to be spoken to your variable. OR
    2b. Use an Interactions block to make an API call to a data source, such as a database. Retrieve some text from the database, and map the text to your variable.
  2. Add a Speak block with the variable name.
  3. Test.
1 Like

Okay, it works. We had an error in a code block, so the variable defaulted to a value of 0.