---
title: "Salesforce Data Source"
canonical: "https://help.cartinuum.com/space/GC1/4172709979/Salesforce%20Data%20Source"
format: markdown
---
In Connect for ArcGIS, data sources provide connectivity to third-party business systems. The **Salesforce** data source allows you to fetch real-time data from your SalesForce instance to display in your ArcGIS web mapping applications using the [Salesforce Object Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm).

Using SOQL you can configure queries that will bring back customer data based on features on your ArcGIS web map.

Below is an example query that will retrieve information about the latest sales for a customer to show alongside the map.

> `SELECT Amount, LastModifiedDate, Name`  
> `FROM Opportunity`  
> `WHERE Opportunity.Account.Name = '{{SF_ACCOUNT}}'`  
> `AND StageName = 'Closed Won'`  
> `ORDER BY LastModifiedDate DESC`

In this example we have a map layer with an attribute called **SF_ACCOUNT** which is used to join the map features to the Salesforce opportunity records.

## Data Source Configuration

The Salesforce data source configuration requires three fields: -

- Username - the username of the account that Connect for ArcGIS will use to login to your Salesforce instance.
- Password - the password for the account.
- Security token - the security tokens are created on the "My Personal Information" page in Salesforce and are used for machine-to-machine authentication.

*It is important when configuring any integration service to follow the Principle of Least Privilege. Any credentials used for the data source should only be able to access the minimum amount of information to meet the needs of your Connect* for ArcGIS* application. For example, do not provide the admin credentials for your Salesforce if Connect* for ArcGIS* only needs to access a single object type. Best practice is to create a new user with the least required privileges.*

## Layer Link Configuration

The Salesforce layer link configuration requires two fields: -

- SOQL statement - a query statement using the SOQL syntax. Use the [+] button to include feature attributes as part of your query statement.
- Max record count - the maximum number of Salesforce records to be returned for each map feature.

An [SOQL reference guide](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm) is available on the Salesforce website.

Salesforce also provides [a Workbench tool](https://workbench.developerforce.com) that can be used to build and test your SOQL queries before adding them to Connect for ArcGIS.

![image](media://6252d080-1182-4605-8f5f-024ffec52a11)