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.
Add a Collect input block by dragging and dropping it to your flow.

A Collect input gets info from the user, checks it, and saves it as a variable.

A Collect input will typically do 3 things:
defining which input type you're looking at
Add a question step
A Collect input should clearly ask to the user for some input.

Capture user response as
The Collect input first checks if the input is matching an input type.

If so, the Collect input saves that input under a destination variable.

Input types
Collect input blocks have 3 types of input recognition:
General input types to check if the input follows a desired format.
System input types to check if the input follows a certain Chatlayer built-in entity.
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.
Please note that the number of system entities 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.
General input
The General input type checks if the input follows a desired format.
System entity input
The Collect input parser can check if the given input is consistent with the format for one of the following system entities. Whenever a system entity is chosen in the 'Check if response matches' dropdown, you can give the variable a name that works for you.

Entity input
After you created an entity, you can check that the user input matches it.
Check if the input matches
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:
The value matches, and the variable is filled.
The value doesn't match, and the fallback questions are asked.
The user doesn't answer, and you decide to detect this silence.
If the variable has a value already, the bot will automatically skip the Collect input block.
When the user response matches
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 debugger.
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 response doesn't match
When the user provides an invalid response the bot should inform the user that their answer was invalid.
Retries
Set up how many times you want the bot to ask the question again. Typically, this would just ask to reformulate.

Fallback
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.

No response
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).

Capture user response as
The bottom of your Collect input block can be configured so that you're sure to detect the answer that you're looking for.

Disable NLP
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.
For date variable: Always past - always future
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.
Last updated
Was this helpful?