Salesforce Sync
Bidirectional sync between Keva customers and Salesforce contacts
Sync Keva customer profiles with Salesforce contacts automatically. When customers submit tickets, their information stays synchronized across both systems.
Prerequisites
Before setting up Salesforce sync:
- Salesforce account with API access (Enterprise, Unlimited, or Developer edition)
- Keva Salesforce connector connected via OAuth
- Admin permissions in both Salesforce and Keva
Connect Salesforce
Step 1: Authorize OAuth
- Go to Settings then Integrations then Salesforce
- Click Connect
- Sign in to Salesforce
- Authorize Keva to access your Salesforce data
- You'll be redirected back to Keva
Step 2: Verify Connection
After connecting, you should see:
- Connection status: Connected
- Instance URL (e.g.,
https://yourcompany.salesforce.com) - Last sync timestamp
What Gets Synced
Contacts (Primary)
Customer profiles sync to Salesforce Contacts:
| Keva Field | Salesforce Field | Direction |
|---|---|---|
| Bidirectional | ||
| name | FirstName + LastName | Bidirectional |
| phone | Phone | Bidirectional |
| company | Company | Bidirectional |
| jobTitle | Title | Bidirectional |
| location | MailingCity | To CRM |
| timezone | TimeZone__c | To CRM |
| notes | Description | Bidirectional |
Accounts (Optional)
Link customers to Salesforce Accounts for B2B scenarios:
| Keva Field | Salesforce Field | Direction |
|---|---|---|
| company | Name | From CRM |
| industry | Industry | From CRM |
| website | Website | From CRM |
Custom Fields
Map any Keva custom field to Salesforce:
- Create the custom field in Salesforce (e.g.,
Keva_Ticket_Count__c) - Add mapping in Keva:
totalTicketstoKeva_Ticket_Count__c - Set sync direction
Configure Field Mappings
Access Field Mapping
- Go to Settings then CRM Sync then Salesforce
- Click Field Mappings
- Select object type (Contact, Account)
Add a Mapping
- Click Add Mapping
- Select Keva field from dropdown
- Select Salesforce field from dropdown
- Choose sync direction:
- Bidirectional: Syncs both ways
- To CRM: Keva to Salesforce only
- From CRM: Salesforce to Keva only
- Optionally add transformation
- Click Save
Auto-Mapping (AI-Assisted)
Keva can suggest mappings automatically:
- Click Auto-Map Fields
- Review AI suggestions (shown with confidence score)
- Accept or reject each suggestion
- Save accepted mappings
Name Splitting
Salesforce uses separate FirstName and LastName fields. Keva handles this automatically:
- To Salesforce: "John Doe" splits to FirstName="John", LastName="Doe"
- From Salesforce: FirstName + LastName combines to "John Doe"
For custom name handling, use the split_name transformation.
Sync Triggers
Automatic (Event-Driven)
Sync happens automatically when:
| Event | Action |
|---|---|
| New ticket from unknown customer | Create contact in Salesforce |
| Customer profile updated | Update Salesforce contact |
| Salesforce contact updated | Update Keva profile (via webhook) |
Manual Sync
Sync a single customer:
- Go to the ticket or customer profile
- Click the Salesforce icon in the sidebar
- Click Sync Now
Batch Sync
Sync all customers:
- Go to Settings then CRM Sync then Salesforce
- Click Run Batch Sync
- Monitor progress (100 customers per batch)
Webhook Setup (Inbound Sync)
To receive updates from Salesforce, configure Outbound Messages:
Step 1: Create Outbound Message
In Salesforce Setup:
- Go to Workflow Rules then Outbound Messages
- Click New Outbound Message
- Select object: Contact
- Configure:
- Name:
Keva Contact Sync - Endpoint URL:
https://app.keva.support/api/webhooks/salesforce - User: Your integration user
- Fields: Select all fields to sync
- Name:
Step 2: Create Workflow Rule
- Go to Workflow Rules
- Create new rule for Contact object
- Evaluation criteria: Created, and any time it's edited
- Add Workflow Action: Select your Outbound Message
- Activate the rule
Step 3: Verify in Keva
- Go to Settings then CRM Sync then Salesforce then Webhooks
- Verify webhook is registered
- Test by updating a contact in Salesforce
Troubleshooting
"Contact not found" Error
Cause: Email mismatch between Keva and Salesforce.
Solution:
- Check the customer's email in both systems
- Manually link via customer profile if needed
- Ensure email is the primary identifier
"DUPLICATE_VALUE" Error
Cause: Contact already exists in Salesforce with same email.
Solution:
- Keva automatically searches by email before creating
- If still failing, check for duplicate rules in Salesforce
- Consider enabling "Allow duplicates" for initial sync
"FIELD_CUSTOM_VALIDATION_EXCEPTION" Error
Cause: Salesforce validation rule blocking update.
Solution:
- Check Salesforce validation rules on Contact
- Ensure mapped values meet validation requirements
- Add default transformation to provide fallback values
"INVALID_FIELD" Error
Cause: Mapped field doesn't exist in Salesforce.
Solution:
- Verify field API name (not label)
- Check field exists on correct object
- Ensure field is accessible to integration user
Sync Stuck at "Pending"
Cause: Inngest function not processing.
Solution:
- Check Inngest dashboard for errors
- Verify Salesforce OAuth token is valid
- Reconnect Salesforce if token expired
Webhook Not Receiving Updates
Cause: Salesforce Outbound Message not configured correctly.
Solution:
- Verify endpoint URL is correct
- Check Salesforce Outbound Message queue for failures
- Ensure workflow rule is active
- Test with Salesforce's "Test Connection" feature
Best Practices
Initial Setup
- Start with default mappings - Add custom mappings later
- Test with one customer - Verify sync works before batch
- Use sandbox first - Test in Salesforce sandbox environment
Field Mapping
- Use bidirectional sparingly - Reduces conflict potential
- Set reasonable defaults - Prevent validation errors
- Document custom mappings - Track what syncs where
Performance
- Batch sync during off-hours - Avoid API limit issues
- Monitor sync history - Catch errors early
- Review failed syncs weekly - Fix mapping issues
API Reference
Trigger Sync Programmatically
POST /api/crm/salesforce/sync
Authorization: Bearer keva_live_xxx
Content-Type: application/json
{
"customerId": "uuid-of-customer",
"connectorId": "uuid-of-salesforce-connector"
}Get Sync Status
GET /api/crm/sync-logs?customerId={id}&platform=salesforce
Authorization: Bearer keva_live_xxxResponse
{
"logs": [
{
"id": "uuid",
"operation": "update",
"direction": "to_crm",
"status": "success",
"crmRecordId": "003xxx",
"changes": { "Phone": "+1234567890" },
"createdAt": "2024-03-20T10:30:00Z"
}
]
}