In this article we will discuss how to teach your AI bot to create contacts in the CRM system. The block "Create Contact" only creates an element, it cannot verify whether a contact exists in the CRM. Therefore, you should structure your scripts such that no contact with the same data appears.
The block can create a contact in the following systems:
- Bitrix24
- amoCRM
- YClients
- Altegio
Creating a contact in CRM using a bot
Before configuring the bot, ensure that the company has a CRM system attached. How to connect the CRM to the ChatApp read in the article — "Connecting CRM to the Chat App". Then follow these steps:
1. Go to the script editor;
2. Select the "Create CRM Contact" block from the menu on the left and drag it onto the workspace;
3. Click on "Customize data";
4. Enter your details in the pop-up window.
Important:
- Any field can be entered as variables;
- You can select from a list of employees who are added to your CRM. From CRM, it displays maximum 500 employees;
- If you add an employee ID manually, the value from the CRM system is entered;
- Date of birth is transmitted in the format YYYY-MM-DD. Only in this sequence and only through a hyphen. If you specify a variable, then the date in the variable must be in this format. If not, it will not appear in the contact card.
5. Click "Save";
6. Connect the “Create CRM Contact” block to the previous block.
Done! Now, when the script reaches this block, a contact will be created in the CRM system, and the ID of the created contact will appear in the block results.
Usage example
Let's consider how this block could be used. Suppose we want to use it during nonwork hours when our operators cannot answer, our AI bot would collect initial information and add it to the CRM as a contact card in the form of a "Contact” card.
1. First, let's go to the "Variables" section and create a local variable for each field. How to create variables can be found in the article — "Variables and constants.";
Please note that you cannot create local variables with the name like those of the system variables. So in the example we created {{phoneCRM}} and {{nameCRM}}.
2. Let’s add the “Create CRM Contact” block and fill in the data with variables;
3. Now let’s create a chain in which we will collect the necessary data;
a) First, we send a message asking the client to enter data;
b) Wait for a response from the client;
c) Change the variable created by us to the text of the client's message;
d) Do the same with all the variables.
You can add conditions so that the client writes exactly what is needed. For example, the date of birth requires the format YYYY-MM-DD. Create a condition block and enter a regular expression into it — \d{4}-\d{2}-\d{2}. Display two arrows “True” — if the client entered everything correctly and “False” — if the client entered the date incorrectly. It should look like the screenshot:
Save and publish the script.
Ready! When the client types in chat, the bot will gather all the relevant information and create a contact in the CRM.