# How to Find Contacts by File?

The contact search by file functionality is useful if you have contacts in an Excel file (phone numbers or chat_id) and want to bulk find them in your contact list for further broadcast.

---

## When Needed

- You have a list of contacts in an Excel file that need to be found in the system.
- You need to send a broadcast to clients who are in an external file.
- You need to import contacts from another system for broadcast.

---

## What's Important to Know

- Search is performed only by **"Phone"** or **"chat_id"** fields.
- If the "Phone" field is filled, search will find contacts with the same phone number.
- If the "chat_id" field is filled, contacts with the corresponding chat ID will be found.
- If both fields are specified for search, logical "AND" is used: contacts must match both fields simultaneously.

---

## Prerequisites

- [x] You are logged in with operator or administrator rights.
- [x] You have navigated to the **Clients** module via `Menu -> Clients`.
- [x] You have an Excel file with contacts (phone numbers or chat_id).

---

## Step-by-Step Instructions

1. Go to the **"Clients"** module → **"Actions"** → **"Search by File"**.
2. Click the **"Download Template"** button to get a sample file — an Excel file with an example structure downloads.
3. Open the downloaded template and fill it with your contacts:
   - Add phone numbers or chat_id in the corresponding columns
   - Save the file
4. Click the **"Send File"** button to upload the filled file.
5. Select the uploaded file on your computer.
6. Set field mapping:
   - **First column**: "Search by Field" — select "Phone" or "chat_id"
   - **Second column**: "Column in File" — specify which column in your file contains this data
7. Click the **"Create Broadcast"** button to start mass broadcast to selected contacts.

---

## Search Logic

- **Search by phone**: If the "Phone" field is filled, search will find contacts with the same phone number.
- **Search by chat_id**: If the "chat_id" field is filled, contacts with the corresponding chat ID will be found.
- **Combined search**: If both fields are specified for search, logical "AND" is used: contacts must match both fields simultaneously.

---

## What Happens After

The system finds matching contacts in your base and allows creating a broadcast for found clients. You can configure and send the broadcast to selected contacts.

---

## How to Verify It Worked

- Check that the file uploaded successfully.
- Make sure field mapping is set correctly.
- Check how many contacts were found in the system.
- Create a test broadcast to verify.

---

## Related Materials

- [Send broadcast from Clients module](/en/broadcast/how-to/send-broadcast-from-clients.md)
- [Create broadcast](/en/broadcast/how-to/create-broadcast.md)
- [View broadcast results](/en/broadcast/how-to/view-broadcast-results.md)

