How to Add a User Input Element
A user input element will help you gather and store data from your subscribers to further segment them and target the right audience with personalized messages.
To collect data that users enter use the text field input element in the message builder. The data your subscribers enter will be saved as variables.
Click on the "Message" element and activate the "Wait for the subscriber's response" function.
In the drop-down list, select a validation type for the entered values:
String — used to enter up to 255 text characters.
Number — used to enter numbers. Using the "Action - Add Variable" element, you can add or subtract values.
Date — used to enter dates in DD / MM / YYYY format.
Email — used to enter email addresses. The user’s email address is also saved to the mailing list in the Email Service for creating campaigns.
Phone — used to enter a phone number in international format with country and operator codes. The user’s phone number is also saved to the mailing list in the Email Service for creating SMS campaigns.
URL — used to insert links starting from https: //.
Geolocation — used to share geolocation. This validation type is only supported in Telegram and WhatsApp mobile app. The reply is written into a "string" variable as a link to the location in Google Maps: https://www.google.com/maps/search/?api=1&query=xxxx.
Regular expression — used when there are not enough predefined validation methods to compare the received value from the subscriber with the template value. For example, to check a phrase for the number of keywords, passport number, the presence of spaces in a phrase, or waiting for the input of numbers in a certain range of values. You can compose and check the phrase for validity on the regect101 website.
Image or Document — used to send an image or document.
Please note that the image or document sent by the user remains only in your live chat and is not saved to your variables.
Message when Entering Invalid Data
If the subscriber enters an invalid value, that is, a value that does not meet the validation condition, they will receive a warning message. By default, there is a text for each type that you can edit and add variables and emoji.
Saving to a Variable
The data entered from the user can be saved to an existing variable, or a new one can be created, which will be stored for each subscriber in the "Audience" tab.
You can view saved replies in the "Audience" tab, use variables in subsequent text messages, and create segmented campaigns.
Saving to Email Service
When you receive an email address or phone number from a user, a mailing list is automatically created in the Email service with the chatbot's name. If the chatbot has the same name in different channels, email addresses and phone numbers will be added to the same mailing list.
Also, you can create quick reply buttons - so users can choose one of them and won’t need to type their own response.
You can add quick replies for data with the "String," "Number," and "Regular expressions" validation types. For example, enter a specific word by the user, enter the quantity of a product, or select a product category.
For data with the "Phone" and "Email" validation types, the messenger prompts the users to use the contact details of their account.
Learn more: "How to Use Regular Expressions in Chatbots"
Waiting for an Answer
You can also choose the period to wait for a response from the user. If the user does not respond within the selected time, the wait for a response from the user will expire and the chatbot will no longer check the entered data for validity to record user's response.
Click “Apply” and continue adding elements to your flow. You can divide your scenario and send the next message, depending on whether the user entered the requested data (green dot branch) or not (red dot branch).
How a Data Request Looks in a Messenger
Subscribers will see a down arrow emoji following a message that includes the user input element.
You can view the data that you collect in the “audience” tab, use this data to create personalized and segmented campaigns.
Last Updated: 02.05.2022