> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://docs.mammoth.io/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Salesforce connector

> Connect Mammoth to Salesforce with OAuth for production, sandbox, or custom-domain orgs, query objects with SQL, and save the results as a dataset.

The Salesforce connector imports CRM data from your Salesforce org into Mammoth as a dataset. Authenticate with OAuth using your Salesforce credentials—you enter the login URL of your org, so production orgs (`https://login.salesforce.com`) and sandboxes (`https://test.salesforce.com`) are both supported.

## Before you start

You need:

- A Salesforce account with API access enabled for your user
- Your Salesforce login URL—`https://login.salesforce.com` for production, or your sandbox URL (for example, `https://test.salesforce.com`)

## Step 1: Select the Salesforce connector

1. In Mammoth, go to **Data Library** and click **+ New Dataset**
2. Select **Connectors**
3. Search for **Salesforce**
4. Click the **Salesforce** tile

## Step 2: Authenticate with Salesforce

The Salesforce connector asks for your instance URL before opening the OAuth flow.

![Salesforce New Connection form with the Instance URL (Domain) field filled in and a Connect button](https://docs.mammoth.io/api/v1/images/20260826_105406_salesforce_connection.png)

1. In the **Instance URL (Domain)** field, enter your Salesforce login URL. It is pre-filled with `https://login.salesforce.com`:

   - **Production:** `https://login.salesforce.com` (default)
   - **Sandbox:** `https://test.salesforce.com`
   - **Custom domain:** `https://mycompany.my.salesforce.com`

2. Click **Connect**—Mammoth sends you to your Salesforce login page in the same browser tab

3. Sign in with your Salesforce credentials and click **Allow** to authorize Mammoth

4. You're redirected back to Mammoth automatically with the connection active

> **Tip: Sandbox vs production.**
> If you're connecting to a sandbox, change the instance URL to `https://test.salesforce.com` before clicking **Connect**. The sandbox URL differs from your production org—check with your Salesforce admin if unsure.

## Step 3: Select a Salesforce object and query your data

After authenticating, select the connection under **Existing Connections** to open the query builder. The **List of tables** panel shows the tables this connector exposes. Click a table to load a `SELECT *` query for it and its preview.

### Write a custom Salesforce query

Edit the SQL in the **Enter SQL query** editor and click **Run**. Use the table and column names shown in the table list and the preview.

See [Understanding data preview & query](https://docs.mammoth.io/learn/connectors/understanding-data-preview-query/) for a full guide to the preview screen.

## Step 4: Save the Salesforce dataset

1. Enter a **dataset name** in the **Save table as** field (e.g., *"Salesforce Contacts"*)
2. Check the **Update Method** (the default is **Replace all data**). To change it, click the edit icon, pick an option, and click **Save changes**:
   - **Replace all data**—Replaces all existing data
   - **Add new data**—Adds new data based on a unique sequential column
   - **Replace with new data**—Replaces existing data with new data based on a unique sequential column
   For **Add new data** and **Replace with new data**, also choose a **Key column**—a numeric or date column with incrementing values, such as an ID or a date.
3. Click **Save as dataset**. When the dataset is saved, click **Done**

## Keep Salesforce data up to date

Set up a **Dataset Refresh** automation to re-import your Salesforce data on a schedule.

## Troubleshoot Salesforce connections

### Authorization does not complete

- Mammoth sends you to Salesforce in the same browser tab and returns you to Mammoth afterwards. If you close the tab or deny access, start the connection again
- Confirm the **Instance URL (Domain)** matches the org you sign in to (production or sandbox)
- Confirm with your Salesforce admin that API access is enabled for your user

### Table not visible in the list

- The authenticated user may not have permission to see the object in Salesforce. Ask your Salesforce admin to check the user's object and field permissions.

---
Source: https://docs.mammoth.io/learn/connectors/salesforce-connector.md · Updated: 2026-10-13