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

# Salesforce

> Build dashboards, Sales and CRM panels, and other custom internal tools on top of your Salesforce data

export const IntegrationSuccess = ({integrationName}) => {
  return <p>
      <b>{integrationName} connected!</b><br />You can now use{" "}
      <a href="/building-with-clark">Clark to build</a> with {integrationName}.
    </p>;
};

export const Alert = ({type, title, children}) => {
  const variant = ["info", "success", "warning", "danger", "note"].includes(type) ? type : "note";
  return <div className={`alert alert--${variant}`}>
      <div className="alert-icon" />
      <div className="alert-content">
        {title && <div className="alert-title">{title}</div>}
        <div className="alert-body">{children}</div>
      </div>
    </div>;
};

## Setting up Salesforce

### 1. Create a Salesforce app and add integration

Start by [configuring a connected app](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_basics.htm\&type=5) in your Salesforce account. The app should have [OAuth Settings enabled](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_api_integration.htm\&type=5), specifically using the [OAuth 2.0 Client Credentials Flow](https://help.salesforce.com/s/articleView?id=sf.connected_app_client_credentials_setup.htm\&type=5) authorization flow.

Follow the Salesforce REST API [Quick Start](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart.htm) for a full guide.

Once the app has been created, navigate back to Superblocks and select **Salesforce** from the [integrations page](https://app.superblocks.com/integrations/salesforce).

### 2. Configure settings

Fill out the form with the following settings:

| Setting         | Required                                   | Description                                                                                                                       |
| --------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| Name            | <span className="table-checkmark">✓</span> | Name that will be displayed to users when selecting this integration in Superblocks                                               |
| Instance URL    | <span className="table-checkmark">✓</span> | URL for the Salesforce instance, e.g. <code>[https://your-domain.my.salesforce.com](https://your-domain.my.salesforce.com)</code> |
| Token URL       | <span className="table-checkmark">✓</span> | The full URL path to the token endpoint that serves OAuth tokens                                                                  |
| Consumer ID     | <span className="table-checkmark">✓</span> | A public identifier used to identify this Salesforce consumer to the authorization/token servers                                  |
| Consumer Secret | <span className="table-checkmark">✓</span> | A secret shared between the Salesforce consumer and the authorizing/token servers to verify the Consumer ID                       |

### 3. Test and save

Click **Test Connection** to check that Superblocks can connect to the data source.

<Alert type="info">
  If using Superblocks Cloud, add these <a href="/enterprise/security/overview#ip-addresses">Superblocks IPs</a> to your allowlist (not necessary for Hybrid or Cloud-Prem deployments).
</Alert>

After connecting successfully, click **Create** to save the integration.

### 4. Set data tags

Optionally, configure different data tags for [separate development environments](/development-lifecycle/build/data-tags).

<Alert type="success">
  <IntegrationSuccess integrationName="Salesforce" />
</Alert>

## Creating Salesforce steps

When using Salesforce steps, there are 3 options:

1. [SOQL queries](#soql-queries)
2. [Single object actions](#single-object-actions)
3. [Bulk actions](#bulk-actions)

### SOQL queries

Write **[SOQL queries](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm)** to perform read-only actions on your SFDC data.

### Single object actions

Use **single object actions** to perform CRUD actions on a single object. Pass in an object of data in the **Resource Body**.

* Create a single object
* Update a single object
* Delete a single object
* Read a single object

### Bulk actions

Use **bulk actions** to perform CRUD actions on several objects at time. Pass in an array of objects in the **Bulk Update Body**.

* Create several objects
* Update several objects
* Delete several objects
* Upsert (update or insert) several objects
