# Contacts Management

{{<tags >}}

The **Contacts** section in the **Truora** platform allows you to manage all customer interactions through WhatsApp. Here, you can view, edit, import, and download contacts, as well as track key statistics and manage their information. This guide will walk you through how to effectively use the Contacts section to organize and maintain your customer data.

## View Contacts details

Contacts are displayed in the platform, whether they arrive via **inbound messages**, are **manually created**, or **imported in bulk**. The platform automatically creates and updates contacts as they interact with WhatsApp bots, maintaining interaction counts from the moment the contact is created.

To view contact details, navigate to the **Contacts** section. 

{{<img src="/images/illustrations/customer_engagement/contacts_details.gif" alt="Contacts details" width="100%" class="border border-slate-400 rounded-md">}}

The contacts information is displayed in a table with the following columns:

  - **Contact**: The contact name or phone number (always editable).*
  - **Last interaction**: The date and time of the last interaction with this contact.**
  - **User initiated conv.**: The number of times this contact initiated the conversation ({{< newtab href="/guides/inbound/" >}}Inbound message{{< /newtab >}}).**
  - **Business initiated conv.**: The number of times your company initiated the conversation with this contact ({{< newtab href="/guides/outbound/" >}}Outbound message{{< /newtab >}}).**
  - **Cancelled outbounds**: The number of cancelled interactions when your company initiated the conversation.**
  - **Received notifications**:  The number of single notification messages received by the contact.**
  - **Options**: Here, you can **View details** of the contact or **Delete** the contact.

**Notes:**

  *&nbsp; *Contacts that arrive through inbound messages will typically have their phone number listed as their name if it’s their first interaction or if the name has never been edited.*

  ** *You can sort the information in descending or ascending order by clicking on the column header.*

## Create, Edit and Delete single Contacts

### Create Contact

1. In the **Contacts** section, click on **Actions** > **+Create contact**.
2. Fill in the following information:

    - **Phone number** (**Required**): Select the country (country code) and enter the phone number.
    - **Name** (**Required**)
    - **Email** (**Optional**)
    - **Add custom property**:  If you have previously created custom properties, click here to add and fill in the desired property.*
  
*&nbsp;**Note**: You will learn more about [contact properties](#contact-properties) further in this guide.

{{<img src="/images/illustrations/customer_engagement/create_contact.gif" alt="Create Contact" width="100%" class="border border-slate-400 rounded-md">}}

<br>

### Edit a Contact

1. In the **Contacts** section, click on the contact or click the three dots **Options** > **View details**.
2. Click **Edit** to modify the **Name**, **Email** and any custom property that you have previously created.*

*&nbsp;**Note**: You will learn more about [contact properties](#contact-properties) further in this guide.

{{<img src="/images/illustrations/customer_engagement/edit_contact.gif" alt="Edit Contact" width="100%" class="border border-slate-400 rounded-md">}}

<br>

### Delete a Contact

In the **Contacts** section, click on the three dots **Options** > **Delete**

{{<img src="/images/illustrations/customer_engagement/delete_contact.png" alt="Delete details" width="100%" class="border border-slate-400 rounded-md">}}

---

## Contact Properties

Contact Properties are custom fields that allow you to track specific details relevant to your business needs, such as customer details or purchase status. You can create and manage these properties to better organize and leverage your contact information.

### Create and Edit Properties

**Create Property**

1. Go to **Settings** > **Contact Properties**.
2. Click on **+Create Property** and fill the required fields:
  - **Name**: Name of your custom property.
  - **Type**: The type of data expected. Choose from *Text*, *Number*, *True/False*, *Date*, *Email*, *Value list*.
  - **Hidden**: Check this box to hide the property. Hidden properties won't appear when viewing a contact's details.

3. Click **Create Property**. Your new property should now be listed in the **Contact Properties** tile.

{{<img src="/images/illustrations/customer_engagement/create_property.gif" alt="Create Property" width="100%" class="border border-slate-400 rounded-md">}}

**Edit Property**

  1. In **Settings** > **Contact Properties**, click **Edit** next to the property you want to modify.
  3. Update **Name** or **Hidden** status as needed.
  4. Click **Save**. Your property should be updated in the **Contact Properties** list.

{{<img src="/images/illustrations/customer_engagement/edit_property.gif" alt="Edit Property" width="100%" class="border border-slate-400 rounded-md">}}

---

## Import Contacts

You can import your contacts in bulk using an Excel (.xlsx) file that contains the required properties for the contacts to be imported.

**Key Details**

  - **Duplicate Contacts**: If a contact already exists with the same number, it will not be overwritten; the system will simply move to the next row in the file. The results report will provide immediate feedback on these cases.
  - **Required Format**: The import requires both a **phone number** (with country code) and a **name**.
  - **Custom Properties**: These are optional. If used, ensure that each property has a value in every row. The report will highlight rows missing values for these properties.

**Excel File Requirements**

  - **Column 1**: Phone number (include country code) (**required**).
  - **Column 2**: Name (**required**).
  - **Additional columns**: Email and Custom properties (optional).

**Import Contacts process**

1. In the **Contacts** section, click on **Actions** > **Import contacts**.
2. In the modal window, you can download a template with the required columns if you don't have your Excel file ready yet.
3. Click on **Select file** and choose your prepared file.
4. Assign columns to the contact properties if needed.
5. Click on **Import** to start the process.
6. While the import is **In progress** you can click **Options** to **Stop loading contacts** if needed.
7. When the process is **Finished** you can click **Options** to **Download results** of the process, which will generate the **Contact Import Report** Excel (.xlsx) file.

{{<img src="/images/illustrations/customer_engagement/import_contacts.gif" alt="Import contacts" width="100%" class="border border-slate-400 rounded-md">}}

For this guide, we uploaded the following file:

{{<img src="/images/illustrations/customer_engagement/example_bulk_contacts.png" alt="Example bulk contacts" width="80%" class="border border-slate-400 rounded-md">}}

You can now view the imported contacts in your list. This may take a few minutes, so please be patient:

{{<img src="/images/illustrations/customer_engagement/imported_contacts.png" alt="Imported contacts" width="100%" class="border border-slate-400 rounded-md">}}

---

## Download Contacts

The **Download contacts** feature generates a report with contact history in CSV format. You can choose to download all contacts or limit the download to contacts created within a specified date range, up to the last two months.

1. In the **Contacts** section, click on **Actions** > **Download contacts**.
2. **Date range** (optional): Select a date range to filter contacts by their first interaction or creation date.
3. **Language**: Choose from English, Spanish, or Portuguese.

{{<img src="/images/illustrations/customer_engagement/download_contacts.gif" alt="Download contacts" width="100%" class="border border-slate-400 rounded-md">}}

Here is an example of a downloaded contact history (click to enlarge):

{{<img src="/images/illustrations/customer_engagement/contacts_downloaded_report.png" alt="Download history tile" width="100%" class="border border-slate-400 rounded-md">}}

A few key points from this example report:

  - The same statistics from the [Contact details](#view-contacts-details) view are included in this file.
  - Many contacts have their **Phone number** as their **Name**. This might indicate that these contacts were not manually created and have not been edited yet.
  - The contact created in this guide has the **Name**, **Phone number** and **Client** fields populated as we created it in this guide.
  - The contacts imported in this guide have their **Name**, **Phone number**, **Client** and **Document** fields populated as we imported the file in this guide.
  - The two custom **Contact Properties** created and edited in this guide appear in the last two columns of the report.

### Download history tile

In the **Contacts** section, click on the **Download history** tile to view a list of your past downloads. The list displays:

  - **Creation date**: The date and time the download file was created.
  - **From** and **To**: The time range selected for the report.
  - **Options**: The **download** button to download the report again.

{{<img src="/images/illustrations/customer_engagement/download_history_tile.png" alt="Download history tile" width="100%" class="border border-slate-400 rounded-md">}}

---

## Using Contact Properties in your Flows

>You must be familiar with WhatsApp flows to better understand this section. If not, please visit the {{< newtab href="/guides/flows" >}}Create WhatsApp flows{{< /newtab >}} guide to learn more.

When creating or editing your WhatsApp flows, you can save user responses to flow questions as contact properties. If required, these responses can overwrite property values each time a user goes through the flow, allowing for dynamic data management.

**Keep in mind:**

  - Only properties matching the block's **Expected response type** will be listed in the block configuration.
  - The **Answer Options**  block can save the response as a ***text*** or ***list*** property. However, for a ***list*** property, the response options must exactly match the predefined options; otherwise, the response won’t be saved.

### Example

In a previous section of this guide, we created two **Contact Properties** of different types, which we'll use in this example:
  
  - **Client** of type *Text*
  - **Document** of type *Number*

To save a user response as a contact property:

1. Click on the **Open Question** block of your flow to show its properties.
2. Set the **Expected response type** to match the contact property type (*Text* for **Client**, *Number* for **Document**).
3. In **Contact properties**, enable *"Save response as contact property"* and select the available property. Here you will notice that only the matching type property will be available.
4. **Overwrite previous value**: If you want the new response to replace an existing property value, check this box.

{{<img src="/images/illustrations/customer_engagement/properties_in_flows.gif" alt="Properties in flows" width="70%" class="border border-slate-400 rounded-md">}}
