# Chatbot - Identification using Lead Field

In some Chatbot flows **Chatbot**, it may be necessary to identify a Lead using information already present in the record, such as **CPF, email, phone number or another custom field**.

This identification allows the bot **to locate the contact in the CRM**, personalize the service and use data already recorded in the system.

{% embed url="<https://youtu.be/EKsUw6X2JMc>" %}

***

### 📌 When to use this identification

This feature is useful when the flow needs to:

* Identify a **customer already registered** in the system;
* Retrieve existing information from the **Lead profile**;
* Direct the service based on **data already recorded**;
* Avoid duplicate registrations.

Identification examples:

* CPF or CNPJ
* Email
* Phone number
* Enrollment code
* Order number
* Reservation code

***

### ⚙️ How to configure in the Chatbot

#### 1️⃣ Ask the user for the information

In the Chatbot flow, use a **Question** block to request the data that will be used for identification.

Example:

> “To locate your record, please provide your CPF.”

Define the response type as needed:

* Text
* Numeric
* Email

Save the answer in a **flow variable**.

***

#### 2️⃣ Use the Lead identification action

After collecting the information, add an **Action** block in the flow.

Select the option to **identify or locate Lead** using an existing field.

In the search field, configure:

* **Lead Field:** choose the field that will be used for identification (e.g.: CPF, Email, Phone).
* **Value:** use the variable that stored the user's response.

***

#### 3️⃣ Define the flow behavior

After identification, the flow can follow different paths:

**If the Lead is found:**

* Continue the service with the registration data;
* Update the contact information;
* Route to a specific department.

**If the Lead is not found:**

* Request the data to create a new record;
* Route to a manual service;
* Restart the identification attempt.

***

### 💡 Best practices

✔ Use **unique**fields, such as CPF or email, to avoid identifying the wrong Lead.

✔ Validate the format of the information whenever possible (e.g.: email field).

✔ Inform the user of the reason for requesting the data to improve the experience.

Example:

> “We need your CPF only to locate your record in the system.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sprinthub.com/en/topics/convert/chatbot/chatbot-common-questions/chatbot-identification-using-lead-field.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
