# Get Company Contact Info

The Get Company Contact Info component searches your company contacts during a call and pulls back details such as a contact's name, phone numbers, and email address. You can name the contact outright or let an expression choose one at run time, and the values it finds are saved to variables that later components can read or branch on.

:::note
When more than one contact matches your filters, the component returns the details of the contact that was created most recently.
:::

## Configure the component

1. Drag an **Internal Data Ops** component onto the call flow canvas, then click it to open its settings.

   ![The Internal Data Ops block placed on the call flow canvas](/images/pbx/developer-component-cfd.png)

2. In the **Component Type** drop-down list, choose **Get Company Contact Info**.

   ![Choosing Get Company Contact Info from the Component Type list](/images/pbx/get-company-contact-info-cfd.png)

3. Narrow down the contact you want with the filters below. For any field, you can type a value directly or click the **fx** button to build an expression instead.

   ![Filter fields for identifying the target company contact](/images/pbx/get-company-contact-info-filter.png)

   | Filter | Description |
   |--------|-------------|
   | **Last Name** | The contact's last name. |
   | **First Name** | The contact's first name. |
   | **Email** | The contact's email address. |
   | **Number** | The contact's phone number. The search honors the number matching rule set under **Contacts > Company Contacts > Options > Number Match**. When that rule is **Do Not Match**, the component requires an exact number match. |
   | **Phonebook** | One or more phonebooks to search within. Leave this empty to search every directory. |
   | **Company** | Keywords from the contact's company information. |

   :::tip
   Use the **fx** button to look a contact up from something learned earlier in the call instead of a fixed value. For example, enter `$Session.ani` in **Number** to find the caller by their own number (ANI, Automatic Number Identification: the number that shows as the Caller ID). See [Variables and Functions in Cloud Voice Expression](/pbx/call-flow-designer-guide/constants-and-variables-in-cloud-voice-cfd-expression/) for everything an expression can reference.
   :::

4. Click **Confirm** in the bottom-right corner.

## Variables

Each time the component runs, the contact details it retrieves are written to variables. Any expression-aware component, **Condition**, for instance, can read these variables and route the call based on what was found.

:::note
A single call flow can include more than one Get Company Contact Info component, so each is numbered in the order you add it (Get Company Contact Info 1, Get Company Contact Info 2, and so on). Use the matching index in the variable name to read from the component you mean.
:::

| Variable | Type | Description | Example |
|----------|------|-------------|---------|
| `$GetCompanyContactInfo{index}.contactName` | String | Contact name. | `"Leo Poll"` |
| `$GetCompanyContactInfo{index}.company` | String | Company name. | `"YS"` |
| `$GetCompanyContactInfo{index}.email` | String | Email address. | `"leo@ys.com"` |
| `$GetCompanyContactInfo{index}.phonebookList` | String | The phonebook(s) the contact belongs to. | `"All"` |
| `$GetCompanyContactInfo{index}.remark` | String | Remark about the contact. | `"remark"` |
| `$GetCompanyContactInfo{index}.business` | String | Business number. | `"01082345678"` |
| `$GetCompanyContactInfo{index}.business2` | String | Business number. | `"02160123456"` |
| `$GetCompanyContactInfo{index}.mobile` | String | Mobile number. | `"13800001234"` |
| `$GetCompanyContactInfo{index}.mobile2` | String | Mobile number. | `"15900005678"` |
| `$GetCompanyContactInfo{index}.home` | String | Home number. | `"01087654321"` |
| `$GetCompanyContactInfo{index}.home2` | String | Home number. | `"075523456789"` |
| `$GetCompanyContactInfo{index}.businessFax` | String | Business fax number. | `"01082345679"` |
| `$GetCompanyContactInfo{index}.homeFax` | String | Home fax number. | `"02160123457"` |
| `$GetCompanyContactInfo{index}.other` | String | Other phone number. | `"4008880000"` |

## What it can connect to

A Get Company Contact Info component leads to exactly **one** downstream component. Any of the following can follow it:

| Component | Purpose |
|-----------|---------|
| [Prompt](/pbx/call-flow-designer-guide/prompt/) | Play an audio file or a text-to-speech message to the caller. |
| [Business Hours](/pbx/call-flow-designer-guide/business-hours/) | Route the call to different destinations depending on the time of day. |
| [Menu](/pbx/call-flow-designer-guide/menu/) | Offer callers a set of options and route them by the DTMF (Dual-Tone Multi-Frequency, the tone a phone sends when a key is pressed) key they press. |
| [User Input](/pbx/call-flow-designer-guide/user-input/) | Collect DTMF digits from the caller, usually paired with **Condition** to act on what was entered. |
| [Language](/pbx/call-flow-designer-guide/language/) | Change the system prompt language for the rest of the flow. |
| [Record](/pbx/call-flow-designer-guide/record/) | Start recording once the caller connects to another party, with optional notification prompts, or turn recording off for a call that would otherwise be recorded. |
| [Dial by Number](/pbx/call-flow-designer-guide/dial-by-number/) | Let callers dial a number directly to reach their destination. |
| [Dial by Name](/pbx/call-flow-designer-guide/dial-by-name/) | An end component that lets callers reach a user by typing the first three letters of their name. |
| [Transfer](/pbx/call-flow-designer-guide/transfer/) | An end component that sends the caller to a chosen destination, with optional prompts announcing the transfer. |
| [Hang Up Call](/pbx/call-flow-designer-guide/hang-up-call/) | An end component that disconnects the call. |
| [Condition](/pbx/call-flow-designer-guide/condition/) | Route the call based on logical expressions. |
| [Loop](/pbx/call-flow-designer-guide/loop/) | Repeat a group of components a set number of times or until a condition is met. |
| Internal Data Ops | Read from and write to the Cloud Voice system's own database. See [Get Extension Presence Status](/pbx/call-flow-designer-guide/get-extension-presence-status/), [Set Extension Presence Status](/pbx/call-flow-designer-guide/set-extension-presence-status/), [Get Queue Agent](/pbx/call-flow-designer-guide/get-queue-agent/), [Get Queue Info](/pbx/call-flow-designer-guide/get-queue-info/), [Get Agent Status](/pbx/call-flow-designer-guide/get-agent-status/), [Set Agent Status](/pbx/call-flow-designer-guide/set-agent-status/), [Get System Info](/pbx/call-flow-designer-guide/get-system-info/), [Get System Capacity](/pbx/call-flow-designer-guide/get-system-capacity/), [Get Extension Info](/pbx/call-flow-designer-guide/get-extension-info/), and [Get Company Contact Info](/pbx/call-flow-designer-guide/get-company-contact-info/). |
| [Email Sender](/pbx/call-flow-designer-guide/email-sender/) | Send an email for real-time notifications, alerts, or user-specific information. |
| [Database Access](/pbx/call-flow-designer-guide/database-access/) | Run a SQL (Structured Query Language) operation against an external database during the call flow. |
| [HTTP Request](/pbx/call-flow-designer-guide/http-request/) | Send an HTTP request to an external server to exchange data with a third-party service. |
