> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecorn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce

> Push leads and companies from Pipecorn to Salesforce as Contacts and Accounts or as Leads, import list views, and assign owners.

The Salesforce integration connects the two in both directions:

* **Push to Salesforce.** Send the leads of a search or saved list to
  Salesforce as Contacts linked to their Account, or as Leads.
* **Import from Salesforce.** Bring a Contact or Account list view into
  Pipecorn to enrich it or find more people, and keep Account lists in sync
  every day.
* **Leave out people you already have.** Disqualify the leads that are already
  Contacts or Leads in Salesforce as your searches run.
* **Assign owners.** New records belong to the Salesforce user mapped to the
  teammate who pushed them.

The push dialog, duplicate check and workspace setup work the same way for
every CRM. See [CRM integrations](https://docs.pipecorn.com/integrations/overview.md).

## Connect Salesforce

**1. Start from Pipecorn**

In Pipecorn, open **Settings → Integrations**, go to the **CRM** tab and
click **Connect** next to Salesforce.

**2. Sign in to Salesforce**

Sign in with your Salesforce user and allow Pipecorn's access. You land back
on the Salesforce page in Pipecorn, which loads your Contact, Account and
Lead fields and your active Salesforce users.

**3. Choose Contacts or Leads**

In **Additional Settings**, under **Sync people to**, choose
**Contacts (with Account link)** or **Leads**.

**4. Map your fields**

Map Pipecorn fields to Salesforce fields on the **Contact Mapping**,
**Company Mapping** and **Lead Mapping** tabs. Nothing is mapped for you.

Pipecorn works with what your Salesforce user can see and edit. Your
Salesforce edition needs API access, and your user needs the **API Enabled**
permission.

The integration shows **Set-up your CRM integration** until these are mapped:

* On **Contact Mapping**, or on **Lead Mapping** if you push Leads: First Name,
  Last Name and Most Probable Email.
* On **Company Mapping**: Company Name and Company Domain.

## Map your fields

Map any Pipecorn field, such as job title, location, phone or employee count,
to any Contact, Lead or Account field your user can edit. Text longer than the
Salesforce field allows is cut to fit; emails, URLs and phone numbers never are.

Pipecorn finds your LinkedIn field on its own when it's named
`LinkedIn_URL__c` or `LinkedIn_Profile_URL__c`, or is a custom field with
"linkedin" in its name.

If you add fields or users in Salesforce later, click **Re-sync fields** to see
them in Pipecorn.

## Push leads to Salesforce

From a search or a saved list, open the **Push to** menu and pick
**Salesforce**. Choose the leads to send and click **Start sync**. See
[Push leads](https://docs.pipecorn.com/integrations/overview.md#push-leads) for the filters.

Pipecorn creates or updates the Accounts first, then the people:

* **Contacts (with Account link)**: each Contact is linked to its Account.
* **Leads**: each Lead gets the company name in **Company**, or `Unknown` when
  there is none. Leads aren't linked to Accounts, but Pipecorn still creates or
  updates an Account for each company.

Records are written 200 at a time.

### Duplicate check

Before creating a Contact or a Lead, Pipecorn looks for it in Salesforce with
these steps, in this order, and stops at the first one that finds it:

1. **LinkedIn URL**: the same LinkedIn profile, however the URL is written.
2. **Email**: the same email.
3. **Name + company**: the same first and last name, at the same company.

Accounts are matched by **Domain**, then **LinkedIn page**, then **Name +
country**. Fields you didn't map fall back to Salesforce's standard ones:
**Email**, **First Name** and **Last Name** for people, **Website**, **Account
Name** and **Billing Country** for Accounts. You can reorder the steps and
switch them off on the **Contact Mapping** tab, under **Duplicate check**. At
least one has to stay on.

When several Accounts match, Pipecorn uses the one with the most Contacts, then
the oldest. When several Contacts or Leads match, it creates nothing for that
lead and lists it in the errors. When a Salesforce duplicate rule blocks a
create, Pipecorn links the lead to the existing record the rule found.

Existing records only get their empty fields filled, and only when **Fill
missing contact data ?** or **Fill missing company data ?** is on.

### Campaigns

When you select leads in a saved list and push them with the **Push** button,
Pipecorn also adds them to a Salesforce Campaign named
`Pipecorn import: <list name> - <date and time>`, with the status **Planned**.
Each person is a Campaign Member with the status **Sent**. Pushes from the
**Push to** menu don't create a Campaign.

Creating Campaigns needs the **Marketing User** checkbox on your Salesforce
user.

## Assign owners

On the **User Mapping** tab, map each teammate to a Salesforce user, and pick a
**Default Salesforce User** for the teammates you don't map. New Contacts,
Leads and Accounts belong to the Salesforce user mapped to the teammate who
pushed them. When no user is mapped and there is no default, Salesforce's own
default owner applies.

Pipecorn doesn't change the owner of existing records unless you turn on, in
**Additional Settings**:

* **Reassign Salesforce owner on Contact / Lead updates ?**
* **Reassign Salesforce owner on Account updates ?**

Both are off by default. Teammates who aren't mapped see a reminder on their
dashboard.

## Import a Salesforce list view

Create a new list and choose **Import from your CRM**, then:

* **Import leads**, and pick a **Contact** list view. The people are marked
  qualified, and don't use your lead extraction quota. Lead list views can't be
  imported.
* **Import companies**, and pick an **Account** list view. The companies are
  imported, then enriched. Importing companies uses your company import quota,
  and needs a complete setup.

### Watch the list

For an Account list view, turn on **Watch the list** when you save the list,
or later from the list's menu with **Watch Salesforce list**. Every morning,
Pipecorn adds the companies that joined the list view and removes the ones
that left it, from the Pipecorn list and from its Sales Navigator list.

If Salesforce can't be read, Pipecorn skips that day and changes nothing.

## Leave out people already in Salesforce

Turn on **Automatically disqualify contacts already present in the CRM ?** in
**Additional Settings**. Each new lead of a search is then looked up among
your Salesforce Contacts, then your Leads, with the duplicate check, and the
ones found are disqualified. See
[Leave out people already in your CRM](https://docs.pipecorn.com/integrations/overview.md#leave-out-people-already-in-your-crm).

## What Pipecorn accesses

| Salesforce object | Why |
| - | - |
| Contact, Lead, Account | Find existing records, create and update them on a push, read imported list views |
| Campaign, Campaign Member | Create a Campaign for a push and keep its members in step |
| List View | Show the list views you can import |
| User | List the users you map teammates to |
| Organization | Identify your Salesforce org |

## Disconnect

Open Salesforce in **Settings → Integrations** and click **Disconnect**.
Pipecorn deletes the connection, the field and user mapping and the settings,
and watched lists stop syncing. Records you already pushed stay in Salesforce.

Disconnecting doesn't revoke Pipecorn's access in Salesforce. To revoke it,
also revoke Pipecorn under **Connected Apps OAuth Usage** in Salesforce Setup.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.