Salesforce integration overview

Cloud-based customer relationship management software.

By

Overview

Clay's Salesforce integration enables users to interact with your Salesforce data by looking up, creating, and updating current records with the enrichment panel. Alternatively, you can import records or reports as a source.

This guides covers the following tutorials around Salesforce:

  • Salesforce use cases
  • Setting up the Salesforce integration
  • Importing Salesforce data into Clay
  • Available Salesforce actions
  • Working with SOQL within Clay
  • Managing Salesforce duplicates
  • Salesforce integration best practices
  • (Enterprise Only) Salesforce package overview
  • Frequently asked questions around Salesforce

Supported Actions

Clay currently supports the following Salesforce actions:

  • Import records from a list
  • Import records from a report
  • Create Record
  • Lookup Record
  • Update Record
  • Upsert Object
  • Lookup Records via SOQL

Salesforce Use Cases

Inbound

Auto-Enrich Lead Data from Form Submissions

Automatically enrich inbound leads with data like contact emails, company size, location, and industry using webhooks. Enrichment actions like Find People, Find Technology, or Email Waterfall ensure comprehensive lead profiles. Push this enriched data to Salesforce for lead scoring and prioritization. Check out Clay University’s lesson on inbound enrichment.

Build accurate lead scores

Use Clay’s 95+ enrichment data points and the Formula Tool to create custom lead scores directly in Clay. With AI-powered formulas, easily select key data points for scoring. Push these scores back to Salesforce to prioritize high-value leads. For a detailed guide on lead scoring, check out the Clay University walkthrough.

Sort customers into custom industry categories

Overcome broad CRM filters by categorizing leads into custom-defined industry segments. With Claygent, create detailed classifications (e.g., B2B vs. B2C or 50+ custom categories). Push these segments to Salesforce for more meaningful customer segmentation. Learn how Anthropic used this feature.

Outbound

Find New Companies Matching Your ICP

Streamline lead generation by identifying companies that fit your Ideal Customer Profile (ICP). Use the Find Companies action to locate prospects, check for duplicates with Lookup Records, and enrich new leads. Apply conditional logic to skip enrichment for existing customers and push new ICP-fit records to Salesforce. Explore our guide on how to identify your ICP with Clay based your domain to discover leads.

Engage customers that have changed jobs

Reconnect with customers in new roles to influence purchasing decisions at their new companies. Use Clay’s Track Job Changes action to monitor key contacts and set up enrichment (e.g., Find People) for personalized outreach. Craft tailored messages using GPT and integrate with a sequencer for timely follow-ups.

Run personalized sequences based on company size

Segment leads by company size for targeted sequences. Flag high-priority leads using demographic and firmographic data, then draft tailored messages via Actions > Draft Email. Create dropdown columns (e.g., Add Column > Select) for company size segments and apply conditional snippets for personalized messaging.

Setting up the Salesforce Integration

Requirements to Getting Set Up

Setting up fields for exporting

Export fields refer to the specific CRM fields where data from Clay will be mapped and stored during an integration. These are either pre-existing fields in your CRM (e.g., “Contact Name” or “Lead Status”) or new, custom fields created specifically for handling data from Clay.

When integrating Clay with Salesforce, follow these steps to set up export fields:

Step 1: Decide export field type

Existing Fields: Export Clay data into fields already in your CRM (e.g., “Lead Status” or “Company Name”). Use this if your workflow is established.

Custom Fields: Create new fields in your CRM for data from Clay. This is ideal for testing or tracking new data points.

Step 2 (Optional): Ensure table and CRM data type matches

To avoid export errors, it’s important to match the data type in your Clay table with the corresponding field type in your CRM. Please check the data type of the column you are exporting.

Important: If the data type does not match, the export will fail. Double-check field types in your CRM to ensure successful data transfer.

Step 3: Test and export

Run a small test export to ensure data is mapping correctly to your CRM fields.

Confirm that updates appear as expected and adjust mappings if needed.

Salesforce Permissions

To connect Clay to Salesforce, your Clay user needs the following permissions:

  • Administrative Permissions: API Enabled, View and Edit Converted Leads, View Setup and Configuration
  • General User Permissions: Access Activities
  • Object Permissions: Read, Edit, Create is enabled for the objects you want to enrich (Leads, Contacts, Accounts, Custom Objects)

How to connect Salesforce to Clay

You can connect multiple Salesforce accounts to your Clay workspace.

Step 1: Navigate to the Connections within your Settings

Head over to your Settings section by clicking on your profile picture.

Within Settings, navigate to the Connections section.

To add a Salesforce integration, click Add connection and type in “Salesforce”.

Step 2: Authenticate your Salesforce account

Sign into your Salesforce account and remember to have OAuth Settings enabled. For more information on permission and scope of Salesforce connection, visit our FAQ page.

Step 3: Create your account key

Once you’ve authenticated your Salesforce account, you will be taken to a page “Add Salesforce Account”.

On this page, you can name your Salesforce “Key” (i.e., account name) and set this connected account as the default via the Set as default toggle.

After connecting your Salesforce account to Clay, other members of your workspace will have access to the connected account.

How to import Salesforce data into Clay

You can import records from a Salesforce List or Report into either a new or existing Clay table.

To import:

Step 1: Navigate to the Source panel.

For New Tables: From your Workspace Home, click + Create new and search for “Salesforce” in the source panel.

For Existing Tables: In an existing table, open the table and select Actions > Import to configure Salesforce as a data source.

Step 2: Select the Salesforce account you want to connect.

Step 3: Configure import settings

For lists: Select the object to import and the list view to sync with Clay.

For records: Choose the record to import and optionally specify a uniqueness field. Note: A maximum of 2,000 rows can be imported for records.

Import via Webhook-supported actions

Connecting Clay to Salesforce through webhooks involves additional API configuration. We recommend using Salesforce webhooks only if real-time data is essential for your CRM processes.

For example, you can utilize webhooks for real-time lead scoring to quickly route inbound leads.

To establish this connection, you will need to create a custom workflow and implement Apex code to link your table to Salesforce via a webhook.

Available Salesforce Actions

Within your Clay table, you’re able to run the following Salesforce-supported actions:

  • Create Record
  • Lookup Record
  • Update Record
  • Upsert Object
  • Lookup Records via SOQL

Action: Create Record

Add new records to Salesforce directly from your Clay table. Specify the fields to create or customize records as needed. You can create both standard Salesforce objects and custom objects.

Input Fields

  • Object: Select the object to create (e.g., Contact, Account, Lead, or custom objects). Clay automatically populates the associated properties after selection.
  • Required Fields: Populate all mandatory fields for the selected object (e.g., First Name, Last Name, Email for a Contact) to ensure successful record creation.
  • Optional Fields: Add additional details (e.g., Phone, Job Title) to enhance the record.

Output Fields

  • Record ID: The unique ID of the newly created record in Salesforce (e.g., 003Hs000059er8gIAA).
  • Created Success: A boolean value (true or false) indicating whether the record was created successfully.

Action Walkthrough

Step 1: Select your Salesforce account.

Step 2: Specify the Object you want to create.

Step 3: Map fields from your Clay table to Salesforce object fields, ensuring they match the required data types and formats.

If needed, enable Duplicate Rule Override to allow Clay to bypass duplicate rules and create a new record, even if it’s a duplicate.

Step 4: Configure run settings.

By default, new rows in your Clay table trigger this action. Learn more about auto-update in this guide.

To run only under specific conditions, use formulas that trigger the action when true. Learn more here.

Step 5: Run the action to create a record.

Action: Lookup Record

Lookup a record based on field search criteria. Retrieve specific fields from the record.

Input Fields

  • Object: Select the object to lookup (e.g., Contact, Account)
  • Object Field(s): Specify the field(s) to search within the object.
  • Search Operator: Choose how multiple fields are matched. AND requires all fields to match. OR requires at least one field to match.
  • Filter Field Input: Specify the string to search for within your filter fields.
  • Exact Match: Toggle this to look for an exact match in all search fields. By default, a “contains” search is applied to all fields.

Output Fields

  • Records: A list of the matching records found based on the search criteria.
  • Found At Least One: A boolean value (true or false) indicating whether at least one record was found.

Action Walkthrough

This function searches for the key string you provide within a specific object field, similar to a VLOOKUP in Excel.

Step 1: Select your Salesforce account.

Step 2: Specify the Object you want to lookup

Step 3: Define Search Parameters.

  • Fields to Filter By: Select the fields you want to filter by (e.g., “First Name” or “Email”). These fields will be used as criteria for narrowing down results.
  • Search Operator (Optional): Specify whether the search should use AND or OR logic to combine multiple filters.
  • Field Values: Enter the specific values to search for in the selected fields (e.g., “First Name = John” or “Email = john@example.com”).

You can also specify whether the search should be an exact match or a “contains” search.

Step 4: Configure run settings.

By default, new rows in your Clay table trigger this action. Learn more about auto-update in this guide.

To run only under specific conditions, use formulas that trigger the action when true. Learn more here.

Step 5: Run the action to lookup you record.

Action: Update Record

Update a record based on its Record ID.

Input Fields

  • Record ID: Enter the ID of the record to retrieve and update.
  • Object: Select the object to update (e.g., Contact, Account). Clay populates the associated properties automatically after selection.
  • Record Fields: Populate required fields for the selected object (e.g., First Name, Last Name, Email for a Contact).
  • Optional Fields: Add additional details to enhance the record (e.g., Phone, Job Title).
  • Remove Blank Values: If toggled on, blank values will be excluded from updates to avoid overwriting existing data.

Output Fields

  • Update Success: A boolean value (true or false) indicating whether the record was updated successfully.

Action Walkthrough

To update a record:

Step 1: Select your Salesforce account.

Step 2: Enter the record ID to retrieve.

Step 3: Choose the object type to search for in Salesforce.

Set Ignore blank values to:

  • True: Blank values from Clay will be ignored.
  • False: Blank values will overwrite existing Salesforce values.

Step 4: Configure run settings.

By default, new rows in your Clay table trigger this action. Learn more about auto-update in this guide.

To run only under specific conditions, use formulas that trigger the action when true. Learn more here.

Step 5: Run the action to update your record.

Action: Upsert Object

Update the object based on an upsert field, or create a new one if the field doesn’t exist.

Input Fields

  • Object: Select the object to update (e.g., Contact, Account). Clay automatically populates the associated properties after selection. If the fields do not refresh, manually refresh them.
  • Upsert Field: Specify the field to use for the upsert operation. If no matching field is found, Clay will create a new record.
  • Object Fields: Add additional details to update in the record being upserted.

Output Fields

  • Type: Indicates whether the action resulted in a created or updated record.
  • Success: A boolean value (true or false) that indicates whether the upsert operation was successful.
  • Record ID: The unique ID of the record that was created or updated.

Action Walkthrough

To upsert an object:

Step 1: Choose your Salesforce account.

Step 2: Select the object type to upsert

Step 3: Map fields from your Clay table to Salesforce Object fields.

Ensure fields match the required data types and formats.

Step 4: Configure run settings.

By default, new rows in your Clay table trigger this action. Learn more about auto-update in this guide.

To run only under specific conditions, use formulas that trigger the action when true. Learn more here.

Step 5: Run the action to upsert an object in Salesforce.

Action: Lookup Records via SOQL

Use SOQL to query Salesforce data. If no data matches, an empty object is returned.

For more information on SOQL, please see the section below or visit  Salesforce’s documentation.

Input Fields

  • SOQL Query: Enter the SOQL query you want to execute to retrieve Salesforce data.

Output Fields

  • Records: A list of records matching the query. If no records are found, this will be empty.
  • Found At Least One: A boolean value (true or false) indicating whether at least one record was found.

Action Walkthrough

To lookup a record via SOQL:

Step 1: Select the Salesforce account to use.

Step 2: Enter your SOQL query. ex. SELECT Id, Name FROM Account WHERE Name = 'Sandy'.

Step 3: Configure run settings.

By default, new rows in your Clay table trigger this action. Learn more about auto-update in this guide.

To run only under specific conditions, use formulas that trigger the action when true. Learn more here.

Step 4: Run the action to lookup a record via SOQL in Salesforce.

How to work with SOQL in Salesforce

Within Clay you can use Salesforce Object Query language to search your Salesforce data. Similar to SQL, it uses SELECT statements but is tailored for Salesforce.

Use SOQL when you know the objects where the data is stored, and you want to:

  • Retrieve data from a single object or related objects.
  • Count records that match specific criteria.

A SOQL query consists of three main components:

  • SELECT: Specifies the fields you want to retrieve.
  • FROM: Indicates the object you want to query, which can be standard or custom Salesforce objects.
  • WHERE: Filters the records and allows for sorting based on specific criteria.

SOQL WHERE Syntax

The SOQL WHERE clause uses field expression syntax:

<fieldName> <comparisonOperator> <value>

Comparison Operators

Supported comparison operators include: =, !=, <, <=, >, >=, LIKE, IN, NOT IN, INCLUDES, and EXCLUDES.

Example: SELECT Name FROM Account WHERE BillingState = 'California’

For details on using each comparison operator, see the Comparison Operators documentation.

Logical Operators

Logical operators are used to combine multiple conditions in the WHERE clause of a SOQL query. The key operators are:

  • AND: Returns true if both conditions are true.
    • Example: SELECT Name FROM Account WHERE Type = 'Customer' AND BillingCity = 'San Francisco'
  • OR: Returns true if either condition is true.
    • Example: SELECT Name FROM Account WHERE Type = 'Customer' OR BillingCity = 'San Francisco'
  • NOT: Returns true if the condition is false.
    • SELECT Name FROM Account WHERE NOT Type = 'Prospect’

For more details on using Logical Operators, see the Logical Operators documentation.

Date formats and Date literals in WHERE statements

SOQL supports filtering by date and dateTime fields in the WHERE clause using specific formats:

Date Format

  • Format: YYYY-MM-DD
    • Example: SELECT Id FROM Account WHERE CreatedDate = 2024-01-01

DateTime Format

  • Format: YYYY-MM-DDThh:mm:ss[Z | ±hh:mm]

Variants:

  • UTC (Z): Use Z for Coordinated Universal Time (UTC).
    • Example: SELECT Id FROM Account WHERE CreatedDate = 2024-01-01T12:00:00Z
  • Time Zone Offset (±hh:mm): Specify a time zone offset from UTC using +hh:mm or -hh:mm.
  • Example: SELECT Id FROM Account WHERE CreatedDate = 2024-01-01T09:00:00-08:00

For more details on using date literals and formats, see the Date Formats and Date Literals documentation.

Example SOQL Queries

Retrieve accounts based on industry

SELECT Id, Name, Industry FROM Account WHERE Industry = 'Technology'

Explanation:

  • Purpose: This query retrieves all accounts where the Industry field is set to “Technology.”
  • Notes:
    • The SELECT clause specifies which fields to include in the result (Id, Name, and Industry).
    • The WHERE clause uses the equality operator (=) to filter records based on the Industry field.

Retrieve recently modified contacts

SELECT Id, FirstName, LastName FROM Contact WHERE LastModifiedDate > 2024-01-01T00:00:00Z

Explanation:

  • Purpose: This query retrieves all contacts updated after January 1, 2024.
  • Key Points:
    • The LastModifiedDate field uses the dateTime format (YYYY-MM-DDThh:mm:ssZ).
    • The > operator filters records where the modification date is greater than the specified timestamp.

Retrieve Opportunities with multiple conditions

SELECT Id, Name, Amount FROM Opportunity WHERE StageName = 'Closed Won' AND Amount > 50000

Explanation:

  • Purpose: This query retrieves all opportunities where:
    • The StageName is “Closed Won.”
    • The Amount is greater than 50,000.
  • Key Points:
    • The AND logical operator combines two conditions in the WHERE clause.
    • Each condition must be true for a record to be included in the result.

Managing Salesforce duplicates

Checking for duplicates before exporting

If you’re unsure whether a record already exists within Salesforce, you can use the Lookup Records action to verify before exporting.

This action allows you to check for existing records based on key details such as Email, First Name, Last Name, Company, or Phone Number.

Checking your can help you certain for duplicates and redundant records.

Salesforce integration best practices

Test your workflow before automating

With the Create record and Update record actions, it's best practice to turn off auto-update when starting with a new Clay workflow.

This allows you to manually test a few rows to verify your workflow before enabling automatic uploads.

Use the Lookup Records action early

Since Salesforce actions don’t cost credits, maximize their utility early in your workflow. Key scenarios to use Lookup Records:

  • Avoid duplicates: Check Salesforce to ensure pulled leads aren’t duplicates.
  • Pull CRM data: Enrich your lead list with company data from Salesforce.
  • Exclusion checks: Verify that outbound contacts aren’t on suppression lists.

Qualify Leads early

Not all imported leads are qualified. Use conditional runs to qualify leads early in your Clay workflow and save credits for enriching only the right leads.

  • Actions like Enrich Company or Enrich People are free and often provide enough data for initial lead qualification.

Understand Object relationships

When using Clay for CRM enrichment, it’s important to be aware of key scenarios that can impact how you manage your data effectively and avoid unnecessary credit spend:

Contact has no assigned company

  • Be mindful of contacts that may lack a company association. Clay can help enrich these records, but it’s good to have a solution for handling and enriching unassociated contacts.

Duplicate companies or contacts

  • Duplicates can lead to inaccurate reporting and wasted enrichment credits. Use Clay to identify and consolidate duplicates while preserving the most accurate and enriched fields.

Bonus Enterprise Feature: Salesforce Package

We also provide a Salesforce Package for enterprise plan users.

Step 1: Download the Package

Install the SFDC package in the link provided to you in your email. You can make this viewable only for admins at the start if you’d like

Step 2: Create your Clay Table

Create a new Clay Table with the source as “Import data from Webhook”. Keep this page open so you have quick access to the Webhook URL.

Step 3: Create your Menu Object(s)

In SFDC, select the App Launcher and search “Enrichment Menus”

Create a new Enrichment Menu record:

Fill out the form with the following information

Enrichment Menu Name: The record name for SFDC (Think of this as the name of the action).

The Clay table URL: Copy the Webhook URL from step 2 into this field.

User Label: The name users will see when selecting the action.

Supported Objects: The type of object you’d like this to show up on. I.e if you have an “Enrich Company” option, you should select “Accounts” so this only shows up at the account level.

Step 4: Add the Enrichment Menu Launcher Button

Click the gear button in the top right corner. Select Set up for current app.

Select Object Manager then click on the label for each object where you’d like this button to show up (Accounts, contacts, leads, etc) and complete the following.

Select Page Layouts.

Select the layout where you’d like this button to show up.

Select the Mobile and Lightning Actions section at the top, click and drag Launch Enrichment to the Salesforce Mobile and Lightning Actions section.

You’re done! Head to any object where you’ve enabled the menu and you’ll now see the button which will automatically push that record to your Clay table:)

FAQ

What permissions and scope do I need for the Salesforce enrichment?

Required Permissions for Your Clay User

To connect Clay to Salesforce, your Clay user needs the following permissions:

  1. Access Identity Information: Permission to access identity URL services (e.g., id, profile, email, address, phone).
  2. Manage User Data via APIs: Permission to manage data through APIs.
  3. Perform Requests Anytime: Permission to perform requests at any time (e.g., refresh_token, offline_access)

What permissions and scope do I need for the Salesforce enrichment?

Required Permissions for Your Clay User

To connect Clay to Salesforce, your Clay user needs:

  1. Access Identity Information (e.g., profile, email, address, phone).
  2. Manage Data via APIs.
  3. Perform Requests Anytime (e.g., refresh_token, offline_access).

An OAuth user is required to set up the connection. After setup, any user in your Clay workspace can use the integration.

Connection Scope and Permissions

The Salesforce connection is scoped to the OAuth user who sets it up:

  • Data Pull: Import or look up records within Salesforce, limited to the fields and objects accessible to the OAuth user.
  • Data Push: Create or update Salesforce records if the OAuth user has write access.

For sensitive fields, create a permission set to limit the OAuth user’s access.

Will Clay create duplicate records in Salesforce?

No. By default, Clay will not create duplicate records. You can bypass the duplicate rule option by switching on the "Duplicate Rule Override" in the Create Record enrichment. Learn more about Salesforce's duplicate rules here: https://help.salesforce.com/s/articleView?id=sf.duplicate_rules_map_of_reference.htm&type=5

What are the default sync settings for CRM integrations?

By default, Clay will sync SDFC imports every 24 hours. This means that new records or updates will trigger action runs, which enriches and exports these updated fields.

How do I turn on or off autoupdate?

To turn this off, navigate the top bar and click on your {Table Name}. From the dropdown you can Disable or Enable auto-update.

Is there a way I can test Salesforce enrichments?

Yes, you can test Salesforce enrichments by connecting your sandbox test environment.

Go to Settings > Connections > Salesforce Test Env to set it up.

Can I reverse my Salesforce Enrichment?

Unfortunately, once you update or create an object in Salesforce from Clay, you cannot reverse these actions.

Please confirm with your Salesforce admin before making any changes you are unsure about any changes to your Salesforce CRM.

Do we need to create a custom Salesforce object to integrate Salesforce data?

Nope! One of Clay's benefits is that the user can update any object and any field in Salesforce.