Collect Duration
This interaction identifies numeric representations of time from the input of a user.
How to add interaction
- Click Add new interaction/plugin
- Select Collect Duration
- Specify the interaction name, e.g. ‘Reminder’
- (Optional) Tick Highlight Extracted data in chat for a better user experience
- Click the Add button to add the interaction to the bot’s structure:
After that, specify Bot’s Message along with an Error Response:
How does it work?
If a user's message does not contain valid data, then the bot will give the Error response message:
If a user's message contains valid data, then the system will trigger the interaction that is set in the Connections tab. Otherwise, by default, the Fallback connection is set to 'do nothing'. In this case, the bot will give the same message again. If you change the Fallback connection then the system will redirect a user to another interaction after a correct duration format has been entered.
The same goes for connections: if you add a simple or NLP connection, and if a user's response matches the conditions of one of the connections, then the system will redirect a user to another interaction.
Collected data is displayed in seconds.
For example, you can connect the Collect Duration interaction to the Bot Statement interaction to thank the user for giving the information or ask something else.
Here are examples of valid data that the bot will recognize:
Examples of valid data
"1 year"
"1 month"
"1 week"
"1 day"
"1 hour"
"1 minute"
"1 second"
You can highlight the extracted data in the Test chat. To do so, click the relevant button in the header. The duration is displayed in seconds:
Watch this video tutorial "Obtaining a duration from the user's input with a chatbot''
Updated over 3 years ago
Upon reaching this interaction, Bot stops responding to the user allowing the human counterpart to start the conversation.