# Salesforce Contact Sync

> Keep your Salesforce contacts up to date. Find, update, or create contacts from any external data source in one pass.

Source: https://cotera.co/solutions/ops/salesforce-contact-sync

---

- **Team:** Operations
- **Tools:** Salesforce
- **Difficulty:** easy
- **Setup time:** 5 min
- **Time saved:** 30 min/batch

## How it works
1. **Find or Create** — Looks up contacts by email — updates existing ones, creates missing ones
2. **Smart Updates** — Only changes fields that differ — never clears existing data
3. **Batch Processing** — Handles dozens of contacts in one pass with full reporting
4. **Change Log** — Shows every field updated with before and after values

## Example requests
- Sync these contacts into Salesforce: john@acme.com is now VP Sales, jane@beta.io has phone 555-0123
- Update Salesforce for mike@gamma.com — he changed his title to CTO. If he doesn't exist, create him.
- Sync these 20 conference contacts into Salesforce — update existing, create new

## Prompt

```markdown
## Task

Sync contact data from external sources into Salesforce. Use @Salesforce/Find Contact by Email to check if contacts exist, @Salesforce/Update Contact to update existing records with new information, and @Salesforce/Create Objects to create new contacts for people not yet in the system.

**Example:** Sync these 15 contacts into Salesforce — update existing ones with new titles and phone numbers, create records for anyone new.

## Input

The user will provide either:
1. A list of contacts with emails and updated information
2. A description of what changed (e.g., "these people changed titles")
3. A batch of new contacts to add with existing contacts to update

**Example:** "Sync these contacts: john@acme.com is now VP Sales (was Director), jane@beta.io has a new phone 555-0123, and mike@gamma.com is new — create him as a contact"

## Context

### Workflow

1. For each contact, use @Salesforce/Find Contact by Email to check if they exist in Salesforce
2. For existing contacts, compare the provided data against current Salesforce fields
3. Use @Salesforce/Update Contact to update fields that have changed (title, phone, department, etc.)
4. For contacts not found in Salesforce, use @Salesforce/Create Objects to create new Contact records
5. Report a summary of all updates and creations

### Fields to Sync

**Contact Fields:**
- FirstName, LastName
- Email
- Title
- Phone, MobilePhone
- Department
- MailingAddress (Street, City, State, PostalCode, Country)
- LinkedIn URL (if custom field exists)
- Description / Notes

### Sync Rules

- Only update fields where the new data differs from the current Salesforce value
- Never clear a field — if the new data is empty but Salesforce has a value, keep the existing value
- Log every change with the old and new value
- For new contacts, require at minimum: Email, FirstName, LastName
- If the contact is new and an AccountId is provided, link them to the account

## Output

**Contact Sync Summary**

**Contacts Processed:** [count]
**Updated:** [count]
**Created:** [count]
**No Changes Needed:** [count]

---

**Updated Contacts:**

| Contact | Email | Field | Previous Value | New Value |
|---------|-------|-------|---------------|-----------|
| [John Smith] | john@acme.com | Title | Director | VP Sales |
| [Jane Doe] | jane@beta.io | Phone | (empty) | 555-0123 |
| [Jane Doe] | jane@beta.io | Department | Engineering | Product |

---

**New Contacts Created:**

| Name | Email | Title | Company |
|------|-------|-------|---------|
| [Mike Johnson] | mike@gamma.com | CTO | Gamma LLC |

---

**No Changes Needed:**
- [Sarah Lee] (sarah@delta.com) — all fields already match

---

**Summary:**
- [X] fields updated across [Y] contacts
- [Z] new contacts created
- [W] contacts already up to date
```

## Related reading
- [Salesforce CRM Automation: The 6 Workflows Your Admin Can't Build](https://cotera.co/articles/salesforce-crm-automation-guide.md)
- [Salesforce Lead Automation: From Import to Assignment in Under 2 Minutes](https://cotera.co/articles/salesforce-lead-automation-guide.md)
- [Salesforce Automation Tools: What We Tried, What Worked, and What We Replaced](https://cotera.co/articles/salesforce-automation-tools-comparison.md)

