In this tutorial I'll show how to create a simple bot which would collect customers attributes and limit how many times visitor can try to enter valid information.
This sample by its basics are similar to multiple unknown messages sample
You can download and import bot. download. Just right click and "save link as"
We will need these triggers
- Default - will be executed once chat starts
- Collect order name - collects order number
- Order number collected - Informs a visitor that order number was collected
- Validation failure - Informs about validation failure
- Multiple validation failure - Informs about second attempt validation failure and terminates information collecting process.
Just writes welcome message and displays quick reply buttons.
Collect order name
Main process where all information collecting happens. Here we expect number format. It also has selected triggers on success and validation failure.
Order number collected
Informs that order number was collected and writes a number.
Here we do few tricks.
- Here we use
Restrict execution more than defined timesand we allow one time to proceed further.
- Text message is the message send on very first validation error.
Multiple validation failure
- We send a text message that it was second attempt to submit information.
- We remove
any previous processmeans information collecting process is terminated.