Collect input
A Collect input block can be used to get information from the user. When the user gives information, the bot will first check if the info corresponds to an already known variable.
Last updated
Was this helpful?
A Collect input block can be used to get information from the user. When the user gives information, the bot will first check if the info corresponds to an already known variable.
Last updated
Was this helpful?
Add a Collect input block by to your flow.
A Collect input gets info from the user, checks it, and saves it as a .
A Collect input will typically do 3 things:
A Collect input should clearly ask to the user for some input.
Collect input blocks have 3 types of input recognition:
Chatlayer extracts data from user inputs. For instance, if an input plugin has a type of date and the input is 'I need to be in Paris in two days,' the parser will identify 'in two days' as the date. It converts this into the DD-MM-YYYY format and stores the result in the user session.
The General input type checks if the input follows a desired format.
A Collect input block checks whether the user response matches an already-known variable:
If the variable does not have a value yet, the bot will ask the question written in the Collect input block. At this point, either:
If the variable has a value already, the bot will automatically skip the Collect input block.
If the Collect input block is skipped, that is because the variable is already known. Variables can be known already for various reasons:
The user has answered this question before.
A previous entity was detected with the same variable name.
The user is authenticated and the variable was automatically set.
When the user provides an invalid response the bot should inform the user that their answer was invalid.
Set up how many times you want the bot to ask the question again. Typically, this would just ask to reformulate.
Set up a fallback message to where to redirect the user when the user used all their retries already. Typically, this would lead to help from customer support, for instance.
You can configure the bot to detect when a user remains silent for a specified period. It triggers a specific block when no response is received within the set timeframe or by a predetermined time.
You can set how long it takes for the new block to trigger in the duration field (in minutes or at a specific time). The duration of silence can be from 1 minute up to 1440 minutes (24 hours).
The bottom of your Collect input block can be configured so that you're sure to detect the answer that you're looking for.
Users are able to leave the Collect input if an intent is recognized. For bots with a very small NLP model, this might trigger a false positive. The 'disable NLP' checkbox allows you to disable the NLP model while in the Collect input, which makes sure that whatever the user says gets saved as input.
When you decide to check a date
variable, Chatlayer parses the user expression to match a default date format. If the date you ask should always be in the present or future, you can use these options. A user saying “Thursday” for example will be either mapped to last or next Thursday.
defining you're looking at
your bot behaviour after that
The Collect input first checks if the input is matching an .
For , make sure you use the voiceMessage input type.
If so, the Collect input saves that input under a .
input types to check if the input follows a desired format.
input types to check if the input follows a certain Chatlayer built-in entity.
input types to check the user input with a bot .
Please note that the number of that you can use inside a Collect input block is limited. The system entities that you can use inside those blocks are: sys.email, sys.phone_number, sys.url, sys.number, and sys.time.
It is important to know that intents and entities are processed before parsers. This can be useful for automatically extracting certain pieces of a sentence as an answer to a question. We've provided a great example of this in our .
For the chat widget (web channel), we recommend using the step.
The Collect input parser can check if the given input is consistent with the format for one of the following . Whenever a system entity is chosen in the 'Check if response matches' dropdown, you can give the variable a name that works for you.
For now, this feature is only available for .
Go to your bot .
Go back to your .
After you created an , you can check that the user input matches it.
Learn more about which suits your use case.
, and the variable is filled.
, and the fallback questions are asked.
The user doesn't answer, and you decide to .
If the response is matched at the time where the Collect input gets triggered, it will be saved correctly under the specified variable name in the .