# Setting up a Salesforce connector

### Salesforce Connector¶

{% hint style="info" %}
Warning

This connector is deprecated. It is recommended to use the **HTTP API** instead.
{% endhint %}

<details>

<summary>Prerequisites - Connected App creation¶</summary>

Login to your Salesforce application.

On the top right of the screen click on setup

Then, on the left bar click on `Apps` > `App Manager`

and create a new connected app by clicking on `New Connected App`.

You will then be redirected to the app’s creation screen. You can get a configuration example in the image below :

Finally, you will be redirected to the Connected App configuration screen where you’ll find the client id & client secret for your app.

Use them to configure the oAuth credentials in Toucan’s [credentials manager](https://docs.toucantoco.com/concepteur/power-apps-with-data/02-connectors.html#set-up-oauth2-credentials-for-your-platform).

</details>

This connector is dedicated to extract CRM data from the `salesforce` REST API. First step is to create a connected app in Salesforce.

{% hint style="info" %}
Start the configuration once the **credentials** are configured, add your connector:
{% endhint %}

A pop-up window will open to authorize the connected app to access your data:

<details>

<summary>Pop-up to authenticate</summary>

<figure><img src="https://1809014303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZxYYf1KpgarKMgMsDCrw%2Fuploads%2Fgit-blob-072282955756dffb59fefc9f6d62ea0aa16033ec%2Fsalesforce6.png?alt=media" alt="authorize the connected app"><figcaption><p>authorize the connected app</p></figcaption></figure>

</details>

* then click on the `SAVE` button

{% hint style="success" %}
After successfully configuring the connector, you will be able to find it in the Connector section of the DataHub "Datasource" tab
{% endhint %}

## Click on "Create a new dataset from this datasource "

Mandatory parameter(s)

* `Query`, here an SOQL query is expected to extract the data from the API. [here](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_examples.htm) for some examples.

## Misc

#### Authentication

Salesforce authentication phase can be quite challenging, this [stackoverflow thread](https://stackoverflow.com/questions/12794302/salesforce-authentication-failing) is really helpful for troubleshooting.
