# Salesforce

With Salesforce connected, the agent recognises a caller whose phone number is on a Contact or Lead and greets them by name. If the number is unknown, it can find the record by the name or email the caller gives, create a new Lead with the caller's details and a call summary, and log the call as a completed Task on the matched record.

Open **Integrations - Catalogue - Salesforce - Connect**, then click **Authorize with Salesforce**. The connection uses Salesforce's own sign-in and consent screen; you never paste a Salesforce password into Voice Logica. One connection is shared by the whole company; every agent that turns the Salesforce tool on uses it.

  <ShotPlaceholder
    src="/assets/integrations/salesforce.png"
    name="salesforce-connect"
    alt="Connect Salesforce dialog with Sandbox environment switch and Authorize with Salesforce button"
    capture="Connect Salesforce dialog."
  />

## What you need before you start

- A Salesforce user who can approve app access for the org. A Salesforce administrator is the safest choice.
- Know whether you are connecting the production org or a sandbox.
- Pop-ups allowed for the Voice Logica app. The Salesforce consent screen opens in a new window.

By default you authorize through Voice Logica's standard Salesforce app and nothing has to be created in Salesforce. Only if your company policy requires your own app, create an External Client App (or use an existing Connected App) in **Setup**, enable OAuth with the **api** and **refresh_token** scopes and PKCE, and ask Voice Logica support for the callback URL to enter there.

## What you enter

Everything in the dialog is optional. Leave it as it is to connect a production org with Voice Logica's app.

- **Sandbox environment** — Turn on to sign in to a sandbox org instead of production.
- **Client ID (Consumer Key)** — Under **Use your own Salesforce app**. Only when you use your own External Client App or Connected App.
- **Client secret (Consumer Secret)** — Under **Use your own Salesforce app**. Fill it together with the Client ID, or leave both empty.

## First setup

1. **Integrations - Catalogue - Salesforce - Connect**

   Turn on **Sandbox environment** only for a sandbox org. Fill **Use your own Salesforce app** only if you created your own app.

2. **Authorize with Salesforce**

   Sign in to Salesforce in the new window and approve access. When the window closes, Salesforce shows on **Connected**.

3. **Sync now** (optional)

   On the Salesforce card under **Connected**, **Sync now** loads your Contacts and Leads into Voice Logica immediately. Otherwise they are synced once a day.

4. **My Agents - your agent - Skills - Tools & Workflows**

   Turn **Salesforce** on. Under **Operations** keep **Identify caller by phone** and add the ones you need. Leave **Auto-identify caller on connect** on so the caller is looked up before the agent speaks.

5. **Save** the agent.

6. **Prove it**

   Call the agent from a phone number stored on a Salesforce Contact. The agent should greet you by name. Then call from a number that is not in Salesforce, give a name and company, and check that a new Lead appears in Salesforce after the call (with **Create lead** selected).

## What the agent can do

| Job | Operations |
|---|---|
| Know who is calling | Identify caller by phone; look up a contact by name or by email; get a contact by its Salesforce record id |
| Remember the caller | After the caller confirms a name match, the agent links their number to that record so the next call is recognised at once |
| Capture new business | Create lead for an unknown caller, with name, company, phone, email and a call summary |
| Keep Salesforce up to date | Log call: a completed Task with the outcome on the matched Contact or Lead |

Phone and email lookups check the synced copy first and fall back to Salesforce live. Name lookups search the synced copy only, so a record created after the last sync is found by phone or email until the next sync.

**Create lead** and **Log call** write to Salesforce. They only run when you select them under **Operations**. Salesforce requires a last name and a company on every Lead, so the agent asks for both.

## Troubleshooting

**Authorize with Salesforce opens a window that shows Salesforce sign-in failed**

Salesforce refused the request. The page shows the reason Salesforce returned.

- Signing in to the wrong environment: a sandbox user needs **Sandbox environment** on; a production user needs it off.
- The user is not allowed to approve the app: try again with a Salesforce administrator.
- With your own app: the Client ID and secret must belong to the same app, the app must have the **api** and **refresh_token** scopes, and its callback URL must match the one Voice Logica support gave you.

If nothing opens at all, the browser blocked the pop-up. Allow pop-ups for the Voice Logica app and click **Authorize with Salesforce** again.

**The Salesforce card shows Action needed**

Voice Logica could no longer refresh access to the org, for example because the app access was revoked in Salesforce or the authorizing user was deactivated. Click **Reconnect** on the card and authorize again. Until then, the agent's Salesforce operations fail.

**The agent does not recognise a caller who is in Salesforce**

Check that the number is stored in **Phone** or **Mobile** on the Contact or Lead, that **Identify caller by phone** is selected on the agent, and that you saved the agent. A record added today is picked up by the next daily sync, or immediately with **Sync now** on the Salesforce card.

## Next Steps

[Get an integration working](https://docs.voicelogica.ai/integrations/) - company connection, then the agent tool.  
[Tools & Workflows](https://docs.voicelogica.ai/agent-configuration/built-in-tools/) - where the Salesforce tool is turned on.  
[HubSpot](https://docs.voicelogica.ai/integrations/hubspot/) · [Zoho CRM](https://docs.voicelogica.ai/integrations/zoho-crm/) - other CRM connections.  
[Freshdesk](https://docs.voicelogica.ai/integrations/crm/freshdesk/) · [Zendesk](https://docs.voicelogica.ai/integrations/crm/zendesk/) - support tickets during the call.
