Back to plugin list
salesforce
Official
Premium

Salesforce

The CloudQuery Salesforce plugin extracts information from your Salesforce organization(s) and loads it into any supported CloudQuery destination

Publisher

cloudquery

Latest version

v4.1.1

Type

Source

Platforms
Date Published

Nov 10, 2023

Price per 1M rows

$100

free quota

1M rows

Set up process


brew install cloudquery/tap/cloudquery

1. Download CLI and login

See installation options

2. Create source and destination configs

Plugin configuration

cloudquery sync salesforce.yml postgresql.yml

3. Run the sync

CloudQuery sync

Overview

The CloudQuery Salesforce plugin extracts information from your Salesforce organization(s) and loads it into any supported CloudQuery destination (e.g. PostgreSQL, BigQuery, Snowflake, and more).

Authentication

You will need to create a Salesforce Connected App. This is a Salesforce app that will be used to authenticate with Salesforce. You can create a Connected App in the Salesforce Setup UI. Checkout the Salesforce documentation for more information. Or check out our latest guide to set up a connected app.

Configuration

This example syncs from Salesforce to a Postgres destination:
kind: source
spec:
  name: slack
  path: cloudquery/salesforce
  registry: cloudquery
  version: "v4.0.0"
  tables: ["*"]
  destinations: ["postgresql"]
  # Salesforce specific configuration
  spec:
    client_id: "${SF_CLIENT_ID}"
    client_secret: "${SF_CLIENT_SECRET}"
    username: "${SF_USERNAME}"
    password: "${SF_PASSWORD}"
It assumes that the SF_CLIENT_ID, SF_CLIENT_SECRET, SF_USERNAME and SF_PASSWORD environment variables are set.

Configuration

This is the (nested) spec used by the Slack source plugin.
  • client_id (string) (required)
    This is the consumer key of the connected app. This can be obtained by Creating a Salesforce connected app.
  • client_secret (string) (required)
    This is the consumer secreted of the connected app. This can be obtained by Creating a Salesforce connected app.
  • username (string) (required)
    This is the username of the Salesforce user that will be used to authenticate with Salesforce. This user must have the permissions to access the Salesforce objects you want to sync. It is best to limit the permission of this user to read only.
  • password (string) (required)
    This is the password of the above Salesforce user.
  • include_objects ([]string) (optional)
    By default the plugin will sync all Salesforce objects. If you want to limit the objects that are synced you can specify the objects you want to sync in this array.
  • exclude_objects ([]string) (optional)
    By default the plugin will sync all Salesforce objects. If you want to exclude some objects from being synced you can specify the objects you want to exclude in this array.
  • concurrency (integer) (optional) (default: 10000)
    A best effort maximum number of Go routines to use. Lower this number to reduce memory usage.

Example Queries

List all Salesforce objects

select distinct(object_type) from salesforce_objects;

List all Accounts

select * from salesforce_objects where object_type = 'Account';

Creating Connected Guide

Full documentation is available here. This guide will walk you through the steps to create a connected app.

Pre-requisites

  • Salesforce developer account to be able to access the REST APIs
  • A Salesforce user with the permissions to create connected a

Step 1: Go To Connected App

Go to Setup Screen and search for "App Manager" and click on "New Connected App".
step1

Step 2: Create Connected App

Fill in the fields as the following and click save:
step2

Step 3: Copy Consumer Key and Consumer Secret

Now that this is configured click Manage Consumer Details to view your Consumer Key and Consumer Secret (those will be used as client_id and client_secret to configure your CloudQuery Salesforce source plugin).
step3
And copy the Consumer Key and Consumer Secret somewhere safe so you can provide them as environment variables to the Salesforce plugin.
step4

Step 4: Final Configuration

Depending on where you run CloudQuery your might need to change IP Relxation to Relax IP restrictions or configure the IP address of the machine you run CloudQuery on.
step5


Subscribe to product updates

Be the first to know about new features.