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

# Salesforce

# Connector Details

| Name           | Value                                                                                                                                                                                                                                                                                                             |
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Platform       | [Salesforce](https://salesforce.com)                                                                                                                                                                                                                                                                              |
| Auth Type      | OAuth                                                                                                                                                                                                                                                                                                             |
| Direction      | Bidirectional                                                                                                                                                                                                                                                                                                     |
| Triggers       | <Tooltip tip="3 triggers available by default">Supported</Tooltip>                                                                                                                                                                                                                                                |
| Tap Repo       | [https://github.com/hotgluexyz/tap-salesforce](https://github.com/hotgluexyz/tap-salesforce)                                                                                                                                                                                                                      |
| Target Repo    | [https://github.com/hotgluexyz/target-salesforce-v3](https://github.com/hotgluexyz/target-salesforce-v3)                                                                                                                                                                                                          |
| Tap Metrics    | <p>Usage: <Tooltip tip="high"><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /></Tooltip></p>      |
| Target Metrics | <p>Usage: <Tooltip tip="medium"><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#A9A9A9" size="14px" /></Tooltip></p> |
| Unified Schema | <Tooltip tip="Supported tables: Activities, Contacts, Companies, Deals, Users, Lists">Supported in [Sales Unified Schema](https://hotglue.com/docs/unified).</Tooltip>                                                                                                                                            |

# Credentials Setup - How to create a Salesforce Connected App

Follow the steps below to get the credentials you need to use the Salesforce connector.

The first thing you need to do is go ahead and log in to [Salesforce](https://login.salesforce.com).

Once you are logged in and on the home page, navigate to your **Setup Menu**:

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/SFSetupMenu.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=8283b44db86b5d44c166b429ac447904" alt="Navigate to the SF Setup Menu" width="1513" height="769" data-path="connectors/images/SFSetupMenu.png" />

From your **Setup Menu** go to the left side of the page and select the Apps dropdown. Then, you should go ahead and click on the **Platform Tools** > **External Client Apps** > **Settings** section from the dropdown.

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/SFExternalClientAppSettings.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=cc45eb5ad9ef4bc1974ab32faa330681" alt="Navigate to the External Client App Settings" width="3000" height="1552" data-path="connectors/images/SFExternalClientAppSettings.png" />

Now on this page, you should enable **Allow creation of connected apps** and click **New Connected App**:

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/CreateConnectedApp.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=4ebae7871f58e7162ad392175d11ef3e" alt="Create a new External Client App" width="3014" height="1322" data-path="connectors/images/CreateConnectedApp.png" />

On this page, you should name your OAuth app, put your email as the contact email, and then check the box **Enable OAuth Settings**.

Now that you have enabled OAuth Settings, you should set the callback URL to

```text theme={null}
https://hotglue.xyz/callback
```

Under **Security**, disable `Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows`.

You should also make sure that for the Selected OAuth Scopes, you have enabled the scopes for:

1. `Access and manage your data (api)`

2. `Perform request on your behalf at any time (refresh\\_token, offline\\_access)`

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/SFOAuthSettings.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=36d1314c0bd27764c2a15895487886b1" alt="Enable Salesforce Permissions" width="2414" height="1308" data-path="connectors/images/SFOAuthSettings.png" />

Once you have finished configuring the app, you should go ahead and click Save.

Next, in **OAuth Settings** dropdown for your app, you'll find a button called **Manage Consumer Details**:

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/SFFindConsumerKeyAndSecret.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=6d166ed79636e216938c33a2171157b6" alt="Find SF Consumer Key and Secret" width="2044" height="1324" data-path="connectors/images/SFFindConsumerKeyAndSecret.png" />

Now, you should copy these keys into hotglue, and you will be all good to go to start using the Salesforce source in hotglue.

![](https://files.readme.io/94a53a1-image.png)

And that is it! You have now successfully linked to Salesforce!

# Required Tenant Permissions

The authenticated tenant must have the following System Permissions on their Salesforce Instance:

1. `API Enabled`
2. `View Setup and Configuration`

See the [Salesforce docs](https://help.salesforce.com/s/articleView?id=xcloud.branded_apps_commun_api_permset.htm\&type=5) for how to add these permissions to a permission set.

If you plan on [enabling Salesforce's Bulk API](/connectors/salesforce#salesforce-bulk-api), your tenant also needs the system permission named `Manage Data Integrations`.

# Allowing tenants to link Salesforce Sandbox Instances

The OAuth Authentication flow for Salesforce Sandbox instances is slightly different from production Salesforce instances. As such, you'll need to add the `Salesforce:sandbox` connector as a supported source to your desired flows. **Tenants using sandbox Salesforce credentials must link to this source, not the normal Salesforce source.**

> Production Salesforce OAuth apps are compatible with sandbox credentials, so you can reuse the same client ID and secret for both supported sources.

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/SFSandboxSupportedSource.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=0ec6a9948a077ea148276b325a5f0cd8" alt="Separate Salesforce and SF Sandbox sources" width="2488" height="874" data-path="connectors/images/SFSandboxSupportedSource.png" />

# API Quota Management

Salesforce enforces strict daily API limits for every connected Salesforce instance. While the [specific request quota differs by Salesforce plan](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm), hotglue's Salesforce connector works around these quotas to prevent eating up your tenants' allotments.

### How hotglue stops you from exceeding Salesforce quotas

By default, a single hotglue job (or discover) will never use up **more than 25% of a tenant's Salesforce API quota**. Additionally, hotglue jobs will never make a request on your tenant's Salesforce account **if making that request would bring the tenant to 80% of their daily quota**.

These thresholds can be customized by  using the `quota_percent_per_run` and `quota_percent_total` config flags respectively on a tenant's linked Salesforce source.

### Salesforce Bulk API

To further minimize Salesforce requests, you can enable the Salesforce bulk API for a tenant using the `"api_type": "BULK"` config flag.

### Incremental Syncs

To prevent re-querying the same data, hotglue's Salesforce connector will only sync data that has been changed since the last successful hotglue job.

### Usage Logging

After making a request, hotglue's Salesforce connector will log how many remaining requests are in a tenant's daily allotment. You can check the usage logs on the hotglue dashboard's job page.

# Campaign, ListView, and Report Filtering

Your tenants may be interested in only syncing Contacts and Leads that belong to certain Campaigns, Listviews, or Reports.

If so, you can add any of the following `filters` to your Salesforce [available source](http://localhost:3000/key-concepts/connectors/v1-sources/overview#what-is-an-available-source):

```json theme={null}
"filters": [
    {
      "label": "Campaigns",
      "description": "The campaigns to sync",
      "type": "multiselect",
      "key": "campaigns",
      "sf_object": "Campaign",
      "targetKey": "campaign_ids"
    },
    {
      "label": "Lists",
      "description": "The lists to sync",
      "type": "multiselect",
      "key": "lists",
      "sf_object": "ListView",
      "targetKey": "list_ids"
    },
    {
      "label": "Reports",
      "description": "The reports to sync",
      "type": "multiselect",
      "key": "reports",
      "targetKey": "report_ids"
    }
]
```

During the widget linking process, the tenant will be given dropdowns for the filters you specify. During the syncing process, hotglue will only fetch Contacts and Leads according to these filters.

# Tap Changelog

<Accordion title="Tap Changelog">
  | Version                                                                                                       | Notes                                                                                                                                         |
  | :------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------- |
  | [v1.5.6](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.5.6)                                    |                                                                                                                                               |
  | [v1.5.4](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.5.4)                                    |                                                                                                                                               |
  | [v1.5.2](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.5.2)                                    |                                                                                                                                               |
  | [v1.5.1](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.5.1)                                    |                                                                                                                                               |
  | [v1.5.0](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.5.0)                                    |                                                                                                                                               |
  | [v1.4.44](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.44)                                  |                                                                                                                                               |
  | [v1.4.43](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.43)                                  |                                                                                                                                               |
  | [v1.4.42](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.42)                                  |                                                                                                                                               |
  | [v1.4.41](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.41)                                  |                                                                                                                                               |
  | [](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.40)                                         |                                                                                                                                               |
  | [v1.4.39](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.39)                                  |                                                                                                                                               |
  | [v1.4.38 - Bug fixes](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.38)                      | - Avoid validating JSON for non-JSON queries                                                                                                  |
  | [v1.4.37 - Minor bug fixes](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.37)                | - Updated query to avoid cloning duplicate records<br />- Updated `backoff` settings to prevent raising errors when retries work successfully |
  | [v1.4.36 - Handle ListViews out of memory](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.36) | Fix issue created by holding ListView data in memory                                                                                          |
  | [v1.4.35 - Support ListView details](https://github.com/hotgluexyz/tap-salesforce/releases/tag/v1.4.35)       | Now pulling entries within each `ListView` by running queries when ListView is fetched as independent stream.                                 |
</Accordion>
