Salesforce
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.
Prerequisites
Before proceeding, ensure the following prerequisites are met:
- Install MindsDB locally via Docker or Docker Desktop.
- To connect Salesforce to MindsDB, install the required dependencies following this instruction.
Connection
Establish a connection to Salesforce from MindsDB by executing the following SQL command and providing its handler name as an engine.
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.
To create a connected app in Salesforce and obtain the client ID and client secret, follow the steps given below:
- Log in to your Salesforce account.
- Go to
Setup
>Apps
>App Manager
. - Click
New Connected App
. - Fill in the required details. Esure that the
Enable OAuth Settings
checkbox is checked, set theCallback URL
to wherever MindsDB is deployed followed by/verify-auth
(e.g.,http://localhost:47334/verify-auth
), and choose the appropriate OAuth scopes. - Click
Save
. - Copy the
Consumer Key
(client ID) andConsumer Secret
(client secret) from the connected app details underConsumer Key and Secret
. - Go to
Setup
>Apps
>Connected Apps
>Manage Connected Apps
. - Click on the connected app name.
- Click
Edit Policies
. - Under
OAuth Policies
, ensure that thePermitted Users
is set toAll users may self-authorize
andIP Relaxation
is set toRelax IP restrictions
. - Click
Save
. - Go to
Setup
>Identity
>OAuth and OpenID Connect Settings
. - Ensure that the
Allow OAuth Username-Password Flows
checkbox is checked.
Usage
Retrieve data from a specified table by providing the integration and table names:
Run SOQL queries directly on the connected Salesforce account:
The above examples utilize salesforce_datasource
as the datasource name, which is defined in the CREATE DATABASE
command.
Supported Tables
The Salesforce integration supports the following tables:
Account
: The table containing account information.Contact
: The table containing contact information for people you do business with.Opportunity
: The table containing sales opportunities.Lead
: The table containing potential sales leads.Task
: The table containing tasks and activities.Event
: The table containing calendar events.User
: The table containing user information.Product2
: The table containing product information.Pricebook2
: The table containing price book information.PricebookEntry
: The table containing price book entries.Order
: The table containing order information.OrderItem
: The table containing order items.Case
: The table containing customer service cases.Campaign
: The table containing marketing campaigns.CampaignMember
: The table containing campaign members.Contract
: The table containing contract information.Asset
: The table containing asset information.
Was this page helpful?