Skip to main content

Using the Question Box in Chatbot Builder

Updated over 2 weeks ago

Summary

The Question Box is one of the most frequently used elements in the WATI Chatbot Builder. It allows you to ask users a question and capture their responses. You can customize it with predefined answer options, allow free-text input, validate responses, and even save answers as variables for further use. This guide covers the key features of the Question Box, how to configure it, and important considerations when using it.

Instructions

Parts of the Question Box

Question Text

The Question Text is the actual question displayed to the user. You can:

  • Add variables (e.g., @{Variable Name}) to personalize the question.

  • Include emojis to make it more engaging.

  • Format text as bold, italic, or strikethrough.

Answer Variants

Answer Variants are predefined response options that users can choose from. If answer variants are provided, users must reply by typing the corresponding number. For example:

  • Yes = 1

  • No = 2 If a user types 1, the chatbot registers the answer as Yes. If you prefer to allow users to enter a free-text response, simply leave the Answer Variants field empty.

Handling Unmatched Responses (Fallback Option)

If a user enters an unexpected response (e.g., "hi" instead of 1 or 2), you can configure a fallback option to guide the chatbot forward. The fallback option (labeled as General) helps handle unrecognized inputs by directing users to another chatbot flow.

Saving Answers in a Variable

User responses can be stored in a variable, which can be:

  • Used in another chatbot step.

  • Checked against conditions for further logic.

  • Displayed back to the user. For example:

  • Case 1: Store the user’s response in a variable for future use.

  • Case 2: Check the value of a stored variable and trigger a condition.

Advanced Options

Text Response Validation

If Answer Variants are not provided, you can enable Advanced Options to validate user responses. This ensures that users provide the expected data format.

Number Validation

  • Requires users to enter a number within a minimum and maximum range.

  • Custom error messages can be set (e.g., "Please enter a number between 1 and 1000").

  • The chatbot can be configured to exit if the user repeatedly enters invalid responses.

Date Validation

  • Accepts formats: M/d/yyyy, MM/dd/yyyy, M/dd/yyyy, MM/d/yyyy.

  • Example: 1/1/2021, 01/11/2021, 1/11/2021.

Date + Time Validation

  • Validates against a 12-hour clock format.

  • Example formats:

    • M/d/yyyy h:mm:ss tt1/9/2021 8:00:00 AM

    • MM/dd/yyyy hh:mm:ss12/25/2020 03:59:05

Time Validation

  • Accepts formats like:

    • hh:mm tt02:35 PM

    • HH:mm:ss14:37:21

    • h:mm:ss tt2:37:00 PM

Pattern (Regex) Validation

  • Allows filtering based on regular expressions (regex).

  • Examples:

    • Only letters (no numbers or emojis): ^([a-zA-Z\s]+)$

    • Email format: ^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$

    • No emojis allowed: ^(?!.[^\u0020-\u007e\u00a0-\u00ff\u0152\u0153\u0178])$

    • Instagram handle: ^instagram\.com/([a-zA-Z0-9_\-\.]+)$

Accepting Media Responses

Previously, if a user sent a media file to the chatbot, it would result in an error. Now, you can configure the chatbot to accept media files such as documents, images, or videos.

Supported Media Types

  • Documents

  • Images

  • Videos

Note: Audio files and voice notes are not supported.

Advanced Options for Media Response

  • Ensures users send the correct file type (e.g., if an image is requested, a PDF will trigger a validation error).

  • Allows downloading of media files using the getMedia API endpoint.

  • Saves the file directory in a variable for further use.

Conclusion

The Question Box in WATI Chatbot Builder is a powerful tool that enables structured interactions with users. Whether you're collecting simple Yes/No responses, validating inputs, or handling media files, these features help improve chatbot functionality. By properly configuring answer options, variables, and validation settings, you can create a seamless and user-friendly chatbot experience.

Frequently Asked Questions (FAQs)

General Questions

  1. What is the Question Box in WATI Chatbot Builder? → The Question Box is a chatbot element that allows you to ask users a question and capture their responses. You can customize it with predefined answer options, allow free-text input, validate responses, and store answers as variables.

  2. Can I use the Question Box for both predefined and open-ended responses? → Yes, you can provide predefined answer options or leave them blank to allow users to enter a free-text response.

Answer Variants & Fallback Options

  1. How do predefined Answer Variants work? → Answer Variants allow users to select from predefined choices. Users must enter the corresponding number to select an option. For example:

    • Yes = 1

    • No = 2

    • If the user types 1, the chatbot registers Yes as the answer.

  2. What happens if a user enters an unexpected response? → If the user provides an unrecognized input, the fallback option (labeled as "General") can guide the chatbot forward by redirecting users to another flow.

Saving Responses

  1. Can I save user responses for future use? → Yes, responses can be stored in a variable and used later in the chatbot flow for conditional logic or display.

  2. How can I check a stored variable value? → You can configure conditions based on stored variable values to trigger different chatbot responses or actions.

Response Validation

  1. What validation options are available for user responses? → You can enable Advanced Options for validation, which includes:

    • Number Validation (Min/Max range)

    • Date Validation (specific formats required)

    • Time Validation (various formats)

    • Pattern (Regex) Validation (custom rules)

  2. How does number validation work? → Users must enter a number within the defined range. If they provide an invalid response multiple times, the chatbot can be configured to exit.

  3. What date formats are supported in Date Validation? → The supported formats include:

    • M/d/yyyy (1/1/2021)

    • MM/dd/yyyy (01/11/2021)

    • M/dd/yyyy (1/11/2021)

    • MM/d/yyyy (01/9/2021)

  4. How does regex validation work? → Regex validation allows you to enforce specific formats. For example:

    • Only letters (no numbers/emojis): ^([a-zA-Z\s]+)$

    • Email format: ^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$

Media Responses

  1. Can the Question Box accept media responses? → Yes, you can configure it to accept images, documents, and videos. Audio files and voice notes are not supported.

  2. What happens if the user sends the wrong file type? → If media validation is enabled, the chatbot will display an error message if the user uploads an incorrect file format (e.g., a PDF instead of an image).

  3. How can I download media responses sent by users? → When media responses are saved, their file directory is stored in a variable. You can use the getMedia API endpoint to download the file.

Did this answer your question?