docs/integrations/app-integrations/salesforce.mdx
This documentation describes the integration of MindsDB with Salesforce, the world’s most trusted customer relationship management (CRM) platform. The integration allows MindsDB to access data from Salesforce and enhance it with AI capabilities.
Before proceeding, ensure the following prerequisites are met:
Establish a connection to Salesforce from MindsDB by executing the following SQL command and providing its handler name as an engine.
CREATE DATABASE salesforce_datasource
WITH
ENGINE = 'salesforce',
PARAMETERS = {
"username": "[email protected]",
"password": "demo_password",
"client_id": "3MVG9lKcPoNINVBIPJjdw1J9LLM82HnZz9Yh7ZJnY",
"client_secret": "5A52C1A1E21DF9012IODC9ISNXXAADDA9"
};
Required connection parameters include the following:
username: The username for the Salesforce account.password: The password for the Salesforce account.client_id: The client ID (consumer key) from a connected app in Salesforce.client_secret: The client secret (consumer secret) from a connected app in Salesforce.Optional connection parameters include the following:
is_sandbox: The setting to indicate whether to connect to a Salesforce sandbox environment (true) or production environment (false). This parameter defaults to false.Retrieve data from a specified table by providing the integration and table names:
SELECT *
FROM salesforce_datasource.table_name
LIMIT 10;
Run SOQL queries directly on the connected Salesforce account:
SELECT * FROM salesforce_datasource (
--Native Query Goes Here
SELECT Name, Account.Name, Account.Industry
FROM Contact
WHERE Account.Industry = 'Technology'
LIMIT 5
);
We have implemented a filtering logic to exclude tables that are generally not useful for direct business queries, which fall into the following categories: