Auto-link Phone Number Matching Logic in Salesforce
Cooby automatically links your WhatsApp contacts with Salesforce records by matching the number in the Phone field. This ensures your WhatsApp conversations are correctly connected to the right Salesforce records.
The following guide explains how Cooby determines matches between WhatsApp numbers and Salesforce phone fields, using Country Selector as the primary factor. Each scenario includes an example table to help you understand how matches are made.
Scenario A: Country Selector is used
When the Country Selector is enabled in Salesforce, phone numbers can be stored in local format (without a country code). Cooby will add the appropriate country code automatically based on the selector.
WhatsApp Contact | Salesforce Phone field | Country Selector used? | Result | Note |
|---|---|---|---|---|
6501234567 | ✅ | ✅ Match | Country code added based on selector | |
02012341234 | ✅ | ✅ Match | Selector completes missing code |
With the selector enabled, Salesforce phone numbers do not need to include country codes. Cooby uses the selector to match the records correctly.
Scenario B: Country Selector is not used
If the Country Selector is not used, Salesforce phone numbers must be saved in E.164 format (e.g., +16501234567). Without a country code, Cooby cannot match the record.
WhatsApp Contact | Salesforce Phone field | Country Selector used? | Result | Note |
|---|---|---|---|---|
❌ | ✅ Match | Both numbers include country code | ||
6501234567 | ❌ | ❌ No match | Missing country code |
When the selector is not used, Salesforce phone numbers must include the full country code for Cooby to match them.
Scenario C: Previously manually unlinked contacts
Contacts that were manually unlinked will not be auto-linked again, regardless of matching phone numbers or selector usage.
WhatsApp Contact | Salesforce Phone field | Country Selector used? | Result | Note |
|---|---|---|---|---|
+16501234567 (previously unlinked) | (650)1234567 | — | ⛔ Not auto-linked | Manual unlink takes priority |
Manual unlinks override all automatic matching behaviors. To match again, the contact must be manually relinked.
Scenario D: Phone numbers use different formatting
Formatting differences (spaces, parentheses, hyphens) do not affect matching as long as the underlying number and country code are the same.
WhatsApp Contact | Salesforce Phone field | Country Selector used? | Result | Note |
|---|---|---|---|---|
❌ | ✅ Match | Formatting differences ignored |
Cooby ignores spaces and formatting variations. Only the numeric value (including country code) is used for matching.
Key Points
- When the Country Selector is used, Salesforce phone numbers may be saved in local format.
- When the selector is not used, phone numbers should follow E.164 format (e.g., +16501234567).
- Manually unlinked contacts will not auto-link again.
- You can manually relink contacts anytime in Cooby.
We hope this document helps you better understand how Cooby works. For any concerns or questions regarding your Salesforce integration, kindly email us at support@cooby.co 💜
Updated on: 19/11/2025
Thank you!
