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

# How To Set Up Affinity For Salesforce

> Help center reference

<Note>
  **How-to** — task-oriented recipe.
</Note>

Once you're done with the [installation process](/s/article/How-to-install-Affinity-for-Salesforce), we'll go over the set up process below for Salesforce and Affinity instances in chronological order.

## Create custom fields in your Salesforce instance

You have the ability to enrich account and contact records in your Salesforce instance with dozens of Affinity Data fields, which contain important information about companies and individuals. To enable this, you'll need to create custom fields in Salesforce for each Affinity field that you'll want to sync.

### Part 1 - Creating custom fields for Account objects

1. First, review the list of Affinity Data fields and how you can create their equivalents in Salesforce: [Creating custom Salesforce fields based on Affinity Data fields](/s/article/Creating-custom-Salesforce-fields-based-on-Affinity-Data-fields)
2. When you're ready to start creating these custom fields, go to Salesforce **Setup**. Then, click on the **Object Manager** tab and click the **Account** object.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/1.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=9a1c054bb68e97615d22e4ae09273ba0" alt="" width="1414" height="436" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/1.jpg" />

3. Now, click on the **Fields and Relationships** tab, then click **New** to create a custom field.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/2.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=df42a33eadcc191ea442cbd2575166eb" alt="" width="1421" height="435" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/2.jpg" />

4. Choose the **Data Type** that is most relevant based on the Affinity Data field you are choosing, then click **Next**.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/3.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=6516c05efa51fd3692838fb8e1ffdc89" alt="" width="1415" height="508" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/3.jpg" />

5. Now, click the checkbox next to **Visible** to make sure all available profiles have access to this field. You can also click the checkbox next to **Read-Only** if you'd like to prevent users from making edits to this field. Then, click **Next**.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/4.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=f9874a6519eea9c24d17fa5ab732466a" alt="" width="3568" height="1660" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/4.jpg" />

6. Repeat as necessary for each field that you want to sync.

### Part 2 - Creating custom fields for Contact objects

Repeat steps 1-6 above, but for **Contacts** this time.

## Disable the "Send through External Email Services" feature

If your organization sends emails through the Salesforce email composer, then your Salesforce admin may have enabled the **Send through External Email Services** feature. This needs to be disabled moving forward, given that it would create duplicate activities alongside enrichment by Affinity for Salesforce.

1. Type "email" in the search bar and click the **Send through External Email Services** tab on the left-side navigation.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/5.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=8d131b22da358b61bc8f3b523856cf0a" alt="" width="1101" height="761" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/5.jpg" />

2. Verify that the settings for Gmail and/or Office 365 are turned off.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/6.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=c8d19519834ab4fa9431c307a866a37c" alt="" width="1374" height="507" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/6.jpg" />

## Set up Affinity for Salesforce in Affinity

1. Sign into your Affinity instance, then click on **Settings** in the top-right corner.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/7.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=a040337619e4cdee80124e0f071c16d7" alt="" width="2869" height="1513" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/7.jpg" />

2. From there, click on the **Users** tab on the left to invite users and set up their Activity Sync Rules.
   * **Important Callout**: If you'd like to connect email aliases for any of your users, please reach out to your Affinity point of contact **before** sending out the invite.
   * **Important Callout**: If you'd like to add Limited Seats (i.e. no access to the [Affinity Pathfinder Chrome extension](/s/article/Chrome-extension), [Affinity for Outlook add-in](/s/article/Affinity-for-Salesforce-How-to-use-Affinity-s-Outlook-add-in), or the Affinity components inside your Salesforce instance), please follow this guide: [Domain Verification Guide for Sync Only seats (Affinity CRM) and Limited seats (Affinity for Salesforce)](/s/article/Domain-Verification-Guide-for-Sync-Only-users)
     <img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/8.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=ccc738834a388017774a696be30d4d7b" alt="" width="1328" height="343" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/8.jpg" />
3. You can also click on the **Blocked Emails** tab and add contacts here whose interactions you would like to prevent from syncing to Salesforce moving forward.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/9.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=9f474e66ad04c2b4fe314f0590652854" alt="" width="1440" height="500" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/9.jpg" />

4. Once you've added all the emails you'd like to hide communications for, click on the **Integrations** tab on the left, then click on **Salesforce**.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/10.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=cb0a2c7ee70ca3543d83a4e49d651e43" alt="" width="1897" height="808" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/10.jpg" />

5. Click on **Affinity for Salesforce** to get started with the set up process.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/11.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=3dab3b93d1c83278ddd7d0c641c24a25" alt="" width="1760" height="960" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/11.jpg" />

6. You'll see that you can connect Affinity to both Production and Sandbox versions of your Salesforce instances by clicking one of the relevant buttons: **Create Production Configuration** or **Create Sandbox Configuration**.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/12.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=4571dad044ba4869faa95bc15dc8fa11" alt="" width="2080" height="1368" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/12.jpg" />

7. You will see a webpage titled **Allow Access?**, where you can click **Allow** to continue.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/13.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=6d24d6a57106ead2ef32a03c17ce1aa4" alt="" width="1246" height="1208" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/13.jpg" />

8. Once you've connected your Salesforce instance, go to the section titled **Select Account and Contact List Views** and select the account list view and contact list view you'd like to enrich with Affinity Data, then click **Save**.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/14.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=2809a8934df8b9f06d1c3f385a998726" alt="" width="1240" height="776" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/14.jpg" />

9. **Set up Enrichment Types**
   * **Field Enrichment - Accounts**: Click the **Edit** button, then click the checkbox to **Create Contacts Under Account List View** - this will help auto-create contacts on Salesforce based on your email interactions. Then, map the [custom Salesforce fields](/s/article/Creating-custom-Salesforce-fields-based-on-Affinity-Data-fields) you already created for your account objects to the Affinity Data fields.
     <img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/15.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=29c18c2eac17fd9d44e1db1a66986a5d" alt="" width="995" height="766" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/15.jpg" />
   * Repeat Step 8.1, but for **Field Enrichment - Contacts** this time.
   * **Account and Contact Enrichment**: Select the enrichment options for your Salesforce instance. Most users will have all of these enabled. Additionally, you can also check the box to **Allow Affinity to pull logged Salesforce Activities into relationship score calculations**.
     * **Note**: If you're using another tool to sync email/calendar data, you can leave the toggles off for those two options. Otherwise, we highly suggest having all enrichment options toggled on for maximum benefit.
       <img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/16.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=fc36fbbb7830ee32797407866d512ecd" alt="" width="1007" height="450" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/16.jpg" />
   * **Opportunity Enrichment**: Click **Edit** to toggle on enrichment for your Salesforce opportunities.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/17.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=edda4bf17d03047aca7c73f7392fc8f1" alt="" width="2092" height="396" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/17.jpg" />

5. You can choose to either enrich the **most recently created** opportunity or the **last modified** opportunity. Finally, click **Save** and you're all set.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/18.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=05d7ee576048001507c4eb791a33fcbf" alt="" width="2010" height="571" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/18.jpg" />

## Set up page layouts in your Salesforce instance

### Part 1 - Setting up page layouts for Account objects

1. Go to **Setup**, then click **Object Manager**, then click **Account**.
2. In the **Account** object, click the **Page Layouts** tab on the left sidebar, then click **Account Layout**.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/19.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=52a2fc083870c2b3401893f7327f71de" alt="" width="1419" height="354" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/19.jpg" />

3. Create a new section within the **Account Layout** so that you can place the custom Salesforce fields you previously created into this new section.
4. Within the **Fields** tab, you'll see the custom Salesforce fields you recently created. Drag-and-drop these fields onto this new section.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/20.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=235590197c7b646e7c6d8931ec9aa705" alt="" width="1415" height="608" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/20.jpg" />

5. You'll also notice the **Highest Relationship Score** provided by Affinity, which didn't appear during the Field Mapping process in the previous section.
   * We highly suggest leveraging the **Highest Relationship Score** in your **Account Layout** so that you and your team members can easily tell the strengths of your/your team's relationships with your accounts and contacts.
     <img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/21.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=d7efcada9c322fc15c9a01624b06ee73" alt="" width="1416" height="480" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/21.jpg" />
   * Drag and drop the **Highest Relationship Score** field into the desired section.
     <img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/22.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=1eaa448386aa59b979c0c8c7196fffcf" alt="" width="1418" height="616" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/22.jpg" />
   * To prevent accidental edits to the **Highest Relationship Score** values, click on the **Edit** icon and check the box for **Read Only**.
     <img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/23.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=c8b9bd183fbbc352dae19aebc23d098a" alt="" width="895" height="255" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/23.jpg" />

6. Scroll down to the **Related Lists** tab, where you'll find the custom object **Affinity Connections** that you can drag-and-drop under **Related Lists**.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/24.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=7c1fe5993591cd3854d40012e7c7a455" alt="" width="1415" height="631" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/24.jpg" />

7. Click the **Edit** icon next to **Affinity Connections**, which will allow you to select which Affinity fields to show and which field to sort by.

<img src="https://mintcdn.com/support-affinity/lgYDtx_FgwCFHQTT/images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/25.jpg?fit=max&auto=format&n=lgYDtx_FgwCFHQTT&q=85&s=e4c0c273c253070711554610094a0463" alt="" width="1421" height="745" data-path="images/integrations-salesforce/how-to-set-up-affinity-for-salesforce/25.jpg" />

### Part 2 - Setting up page layouts for Contact objects

Repeat steps 1-7 above, but for **Contacts** this time. Now that you're done setting up your Salesforce and Affinity instances, let's see how you and your team members can put Affinity for Salesforce into practice (see [How to use Affinity for Salesforce](/s/article/How-to-use-Affinity-for-Salesforce)).
