Skip to main content

Collecting customers attributes and limit how many times he can try

This tutorial explains how to create a bot that collects customer attributes, limiting the number of attempts a visitor has to enter valid information.

This example is similar to the multiple unknown messages sample.

Download

You can download and import the bot: download (right-click and "save link as").

Triggers

These triggers are required:

  • Default: Executed when the chat starts.
  • Collect order name: Collects the order number.
  • Order number collected: Informs the visitor that the order number has been collected.
  • Validation failure: Informs about the first validation failure.
  • Multiple validation failure: Informs about the second validation failure and terminates the information collection process.

Default

This trigger writes a welcome message and displays quick reply buttons.

Collect order name

This is the main process where information is collected. It expects a number format and has triggers set for both success and validation failure.

Order number collected

This trigger informs the visitor that the order number has been collected and displays the number.

Validation failure

This trigger uses a few techniques:

  • It uses Restrict execution more than defined times, allowing the process to proceed only once.
  • The text message is sent on the first validation error.

Multiple validation failure

  • This trigger sends a text message indicating that it was the second attempt to submit information.
  • It removes "any previous process," which terminates the information collection.