Ask a question
  • 08 Jun 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Ask a question

  • Dark
    Light
  • PDF

Article summary

Ask a question by using the “Ask a question” block within the “Ask a question” category. This will allow you to (quite simply) ask the user a question. When answered, the answer can be stored using some of the existing variables, or a custom variable of your choice.

TYPICAL USES FOR THIS:

  • Asking for user details/personal information (Data enrichment/collection).
  • Establishing an answer that will result in triggering other workflows that provide the user with a different interaction pipeline.
  • Creating a more engaging user experience.

Lets unpack the available features within this block and what you can do with it.


Question Text – As the name implies, this is where you will enter your question text to prompt the user for input via your bot. You can enrich the question using variables and styling to include bold, italics or emoticons.

Use a variable such as @@Name for example if you’d like to ask the user a question using their name. For example: “We have your name as John, is this correct?”


Save answers in the variable – This is where the input from the user will be stored when they reply to your bot through WhatsApp. There are 2 types of variables you can use here.

  1. Use an existing system-level variable such as @@Name, @@Genderetc. (In such a case you will want to word your question in such a way it aligns with the type of variable you want to capture data into).
    1. Bot Output: “What is your name?”
    2. User Input to Save answer in the variable: @@Name
  2. Create a custom/new variable that may be specific to your requirements (in other words, you are asking a question that requires an answer that does not have an existing system-defined variable).
    1. Bot Output: “Why do you think Buildabot is awesome?”
    2. User Input to Save answer in the variable: @@awesomebotanswer

When creating a new variable, you will be prompted to select the type of variable with a popup like this:


You must define the “Variable Type” There are 2 options:

  • String (which can consist of any combination of alphanumeric or numeric characters).
  • Number (which can be numeric in value only).

Default Error Message – As the name implies, you can provide an error message of your choice to cue your user with more information on what you expect the format of their answer should be. Useful if you are expecting a specific type of input.


Once created, your question will appear as follows in the bot builder flow:


Let’s take a look at this entire flow below:

Do this by:

  1. Adding a new block.
  2. Selecting “Ask a question” as the category.
  3. Select the “Ask a question” block.
  4. Enter your question in the “Question Text” field.
  5. Select from an existing (or create a new) variable to save the answer (user input) to.
  6. Customize your “Default Error Message” if you’d like.
  7. Click on save to add the block to your bot flow.