# Configure Number Matching in Dynamics 365

Number matching controls how the integration links the external party on a call to a contact record in your Dynamics 365 CRM (Customer Relationship Management system). The external party is the caller on an inbound call or the number you dial on an outbound call. Getting this rule right means each call is tied to the correct contact, so the integration can show who is on the line and log the call activity against the right record. This page explains how to choose between matching the entire number or only its trailing (last few) digits.

## Procedure

1. Sign in to the Cloud Voice App for Dynamics 365 plugin, then click the preferences icon.

   ![Preferences icon that opens the plugin settings](/images/pbx/preferences.png)

   :::note
   The preferences icon opens the plugin settings, where all of the Dynamics 365 integration options (including number matching) live. You need to be signed in to the plugin before these settings appear.
   :::

2. Open the **Dynamics Integration** tab.

3. Under **Number Match**, pick the behavior you want. The rule you choose applies to both inbound and outbound calls.

   - **Exact Match**: compares the caller's or callee's complete number against your CRM records and returns only records whose number is identical.

     ![Number Match set to compare the full external number](/images/pbx/exact-match.png)

     :::tip
     Choose Exact Match when your CRM stores numbers in the same format that calls arrive in (for example, all records saved with the country code). It gives the most precise result and avoids linking a call to the wrong contact.
     :::

   - **Match the last _{{x}}_ digits**: enter how many trailing digits to compare. Dynamics 365 then runs a looser (fuzzy) search, checking only that many final digits of the external number against your CRM records.

     ![Number Match set to compare a chosen count of trailing digits](/images/pbx/partially-match.png)

     :::caution
     Use this option when number formats differ between your calls and your CRM (for example, a call arrives as +1 555 123 4567 but the contact is saved as 555-123-4567). Setting the digit count too low can match unrelated contacts that happen to share the same ending digits, linking the call to the wrong record. Pick enough digits to keep matches unique, such as the last 7 to 10.
     :::

4. Click **Save**.
