# Salesforce

## Overview

The Salesforce Integration enables seamless connectivity between your platform and Salesforce to synchronize and manage data across multiple business functions. This integration supports Helpdesk, CRM, and Content Management capabilities, allowing organizations to streamline customer support, sales operations, and content workflows through a unified system.

### Prerequisites

Before initiating the integration, ensure the following requirements are met:

* An active Salesforce Admin account with appropriate permissions.
* Valid Salesforce domain URL and login credentials.
* Access to the TheLoops platform with Admin role privileges.

### Capability notes

* **Helpdesk:** Requires full configuration including “Pull Record By” selection and all mandatory fields.
* **CRM:** Configuration is identical to Helpdesk.
  * The only difference is selecting **CRM** as the capability in the **Basic** tab.
* **Content Management:** Requires minimal configuration.
  * Only **Environment** and **Salesforce Domain** fields are required in the **Authentication** tab.
  * Select **Content Management** as the capability in the **Basic** tab.

### Best practices

* **Leverage browser session authentication:**\
  If you are already logged into your Salesforce account in the same browser, the authentication step may be completed automatically without re-entering credentials due to browser session caching.
* **Use appropriate permissions:**\
  Always ensure the Salesforce account used has sufficient permissions to access and retrieve helpdesk/CRM/Content Management records.
* **Choose the correct data sync option:**\
  Select “Created Time” or “Updated Time” based on your data synchronization requirements to avoid missing or duplicating records.
* **Validate post-setup:**\
  Always perform a Test Connection after setup to ensure a stable and successful integration.
* **Proactive token management:**\
  Periodically monitor OAuth token validity and regenerate tokens before expiration to avoid integration disruptions.
* **Maintain credential security:**\
  Avoid sharing Salesforce credentials and ensure they are stored securely following your organization’s security policies.

## Setup instructions <a href="#setup-instructions" id="setup-instructions"></a>

### Getting started

{% stepper %}
{% step %}
Log in to TheLoops platform using an **Admin** account.
{% endstep %}

{% step %}
Navigate to **Settings → Integrations** module.
{% endstep %}

{% step %}
Click on the **“+ Add Integration”** button to view available integrations.
{% endstep %}

{% step %}
Search for **Salesforce** and select the integration.
{% endstep %}
{% endstepper %}

### Configuration

{% stepper %}
{% step %}
In the **Basic** tab, enter a suitable name for the integration.
{% endstep %}

{% step %}
Select the required **Capability** based on your use case:

* **Helpdesk**
* **CRM**
* **Content Management**
  {% endstep %}

{% step %}
Click **Next** to proceed.
{% endstep %}
{% endstepper %}

### Authentication <a href="#authentication-setup" id="authentication-setup"></a>

#### For Helpdesk & CRM capabilities:

{% stepper %}
{% step %}
In the **Authentication** tab, select the preferred **Environment**.
{% endstep %}

{% step %}
Choose the appropriate option from **“Pull Record By”**:

* Created Time
* Updated Time
  {% endstep %}

{% step %}
Enter your **Salesforce domain URL** in the designated field.
{% endstep %}

{% step %}
Fill in all mandatory fields as required.
{% endstep %}
{% endstepper %}

#### For Content management capability:

{% stepper %}
{% step %}
Select the preferred **Environment**.
{% endstep %}

{% step %}
Enter your **Salesforce domain URL**.

* *(Note: Only these two fields are required for this capability.)*
  {% endstep %}
  {% endstepper %}

### Connection & authorization

{% stepper %}
{% step %}
Click on the **Connect** button.
{% endstep %}

{% step %}
A Salesforce authentication window will open.
{% endstep %}

{% step %}
Enter your Salesforce credentials and click **Login**.
{% endstep %}

{% step %}
An access permission window will appear.

* Click on **Allow** to grant required permissions.
  {% endstep %}
  {% endstepper %}

### Validation & verification <a href="#validation-and-verification" id="validation-and-verification"></a>

{% stepper %}
{% step %}
Upon successful authentication:

* The integration will be added successfully.
* A confirmation (success message) will be displayed.
  {% endstep %}

{% step %}
Navigate back to the **Integrations** tab and verify that the newly added integration appears at the top of the list.
{% endstep %}

{% step %}
Click on the **Test Connection** icon (next to the delete option):

* If successful, a confirmation message will appear.
* This confirms that the integration is configured correctly.
  {% endstep %}
  {% endstepper %}

## Token management (OAuth integration) <a href="#token-management-oauth-integration" id="token-management-oauth-integration"></a>

### Overview

For OAuth-based integrations, access tokens are time-bound and expire after a defined duration. Once expired, the Test Connection will fail, indicating that re-authentication is required. TheLoops platform provides a seamless way to regenerate the token without re-creating the integration.

### Token regeneration steps <a href="#token-regeneration-steps" id="token-regeneration-steps"></a>

{% stepper %}
{% step %}
Navigate to the **Integrations** module.
{% endstep %}

{% step %}
Click the **Test Connection** icon; if it fails, it indicates that the token has expired.
{% endstep %}

{% step %}
Click on the **Edit** icon (located beside the delete icon) for the integration requiring token refresh.
{% endstep %}

{% step %}
Go to the **Authentication** tab.
{% endstep %}

{% step %}
Click on the **“Re-generate Token”** button.
{% endstep %}

{% step %}
An authentication window (similar to the initial setup) will appear.
{% endstep %}

{% step %}
Enter your Salesforce credentials and click **Login**.
{% endstep %}

{% step %}
Upon successful authentication:

* The token will be refreshed.
* A success message will be displayed.
  {% endstep %}

{% step %}
Return to the **Integrations** list and click on **Test Connection**.

* A successful response confirms that the token has been refreshed correctly.
  {% endstep %}
  {% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.theloops.io/cxplatform/ifs-loops-cx-platform/integrations/salesforce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
