The widget provides the ability to place visual forms to collect various data from users. This makes it easy and efficient to organize feedback, information gathering, and other customer interactions.
Features of using forms:
- In the block Question there must be text in order for the form to be activated and displayed correctly.
- The forms work only in the new widget, which is available in personal account.
- You can create your own forms or use ready-made templates to simplify the setup process and save time.
- In the forms, you can configure data validation using regular expressions. For more information about regular expressions and how to use them, see the article Regular expressions.
- Log in to personal account.
- Create a script of the bot.
- Create a text bot that will respond to your potential customers in the widget.
- Place widget on your site.
-
Go to the section Bot personal account.
-
Click on the desired scenario. The previously created bot script opens.
-
Go to the block Question.
-
Open the Actions tab in the block properties.
-
Select Add Form from the drop-down list.
-
Select a template from the drop-down list:
- Name and email request is a template that can be customized at your discretion. Collects the user's name and email address.
- Full NAME request is a template that can be customized at your discretion. Requests the user's full name, including last name, first name and patronymic.
- Phone Request is a template that can be customized at your discretion. Collects the user's phone number.
- Selection Request is a template that can be customized at your discretion. Collects the user's phone number.
- Create your own — create a form from scratch, adding arbitrary fields and customizing them as you see fit.
Using a templateCreating your own formA template for the feedback form will be displayed, which you can leave or edit.
- Enter a custom name for the form.
- (Optional) Edit the form elements. To do this, click
in the row of the desired element.
- (Optional) Press +Add an item to add a new form element. The element editing window will be displayed.
- (Optional) Hold it down
in the appropriate line of the element to change the order in the future feedback form.
An empty feedback form template will be displayed, which needs to be edited.
- Enter a custom name for the form.
- Edit the form element. To do this, click
in the element line.
- Select the item type.
When selecting the Button type, specify only the button text.
- Specify the variable in the Name field.
- Select the data type from the drop-down list.
- Enter the name of the item that will be displayed to the client. The title should be short and informative.
- (Optional) Enter a short description of the item that will be displayed in the item field.
- Specify whether the field is required. By default, the field is considered mandatory.
- Enter an explanation for the checkbox that will be displayed next to it.
- (Optional) Click Add Validation Rule.
- Add the code to check the regular expression in the Value field. For more information about regular expressions and their examples, see the article Regular expressions.
- Enter the text in the Message field that will be displayed if the entered value does not match the regular expression pattern.
- Click Done.
- Press +Add an item to add a new form element. The element editing window will be displayed.
- Repeat the steps from step 8 if necessary.
To interact with the form, add at least one button. When you click on it, a message is sent to the chat. There may be several such buttons, but all of them will only perform the action of sending a message to the chat.
- (Optional) Hold it down
in the appropriate line of the element to change the order in the future feedback form.
- Go to the section Bot Scripts personal account.
- Click on the desired scenario. The bot script editor opens.
- Click on the block A question that has a form. The block properties will open.
- Go to the Actions tab.
- Click on
in the section, use the form. The form will be deleted.
- Save the script.
Each element of the feedback form has its own variable. To view the variable name, click
opposite the element of interest. The variable name is specified in the Name field.
To extract the data collected through the form, use a variable of the form {clientMetadata.values.variable name}. This makes it convenient to process and integrate the received data into further processes.