Skip to content

Salesforce

Salesforce is a cloud-based customer relationship management (CRM) platform that helps businesses manage sales, customer interactions, and business processes. It provides tools for sales automation, customer service, marketing, analytics, and application development.

Ingestr supports Salesforce as a source.

URI format

The URI format for Salesforce is as follows:

salesforce://?username=<username>&password=<password>&token=<token>&domain=<domain>

URI parameters:

  • username is your Salesforce account username.
  • password is your Salesforce account password.
  • token is your Salesforce security token.
  • domain is your Salesforce instance domain.

You can obtain your security token by logging into your Salesforce account and navigating to the user settings under "Reset My Security Token."

Setting up a Salesforce Integration

You can obtain an OAuth access token by setting up a connected app in Salesforce and using OAuth 2.0 authentication. For more information, see Salesforce API Authentication.

Example

Let's say:

  • Your Salesforce username is user.
  • Your password is password123.
  • Your security token is fake_token.
  • Your domain is test.salesforce.com.
  • You want to ingest account data from your salesforce account
  • You want to save this data in a duckdb database sf.db under the table public.account

You can run the following command to achieve this:

sh
ingestr ingest \
  --source-uri "salesforce://?username=user&password=password123&token=fake_token&domain=test.salesforce.com" \
  --source-table "account" \
  --dest-uri "duckdb:///sf.db" \
  --dest-table "public.account"

Tables

Salesforce source allows ingesting the following objects into separate tables:

TablePKInc KeyInc StrategyDetails
user--replaceRefers to an individual who has access to a Salesforce org or instance.
user_role--replaceA standard object that represents a role within the organization's hierarchy.
opportunityidlast_timestampmergeRepresents a sales opportunity for a specific account or contact.
opportunity_line_itemidlast_timestampmergeRepresents individual line items or products associated with an Opportunity.
opportunity_contact_roleidlast_timestampmergeRepresents the association between an Opportunity and a Contact.
accountidlast_timestampmergeIndividual or organization that interacts with your business.
contactid-replaceAn individual person associated with an account or organization.
leadid-replaceProspective customer/individual/org. that has shown interest in a company's products/services.
campaignid-replaceMarketing initiative or project designed to achieve specific goals, such as generating leads.
campaign_memberidlast_timestampmergeAssociation between a Contact or Lead and a Campaign.
productid-replaceFor managing and organizing your product-related data within the Salesforce ecosystem.
pricebookid-replaceUsed to manage product pricing and create price books.
pricebook_entryid-replaceRepresents a specific price for a product in a price book.
taskidlast_timestampmergeUsed to track and manage various activities and tasks within the Salesforce platform.
eventidlast_timestampmergeUsed to track and manage calendar-based events, such as meetings, appointments, or calls.
custom:<custom_object_name>--replaceTrack and store data that’s unique to your organization. For more information about custom objects in Salesforce, read here

Use these as --source-table parameters in the ingestr ingest command.

Examples

Copy user_role data from Salesforce into a DuckDB database:

sh
ingestr ingest \
  --source-uri "salesforce://?username=<username>&password=<password>&token=<token>&domain=<domain>" \
  --source-table "user_role" \
  --dest-uri "duckdb:///sf.db" \
  --dest-table "public.user_role"

Copy custom object data from Salesforce into a DuckDB database:

sh
ingestr ingest \
  --source-uri "salesforce://?username=<username>&password=<password>&token=<token>&domain=<domain>" \
  --source-table "custom:My__Community_Group__c" \
  --dest-uri "duckdb:///sf.db" \
  --dest-table "public.my_community"

WARNING

Salesforce API limits may affect the frequency and volume of data ingestion. Incremental loading is supported for objects with the SystemModstamp field, but some objects may require full-refresh loads. This is indicated by mode in the tables above. Tables with mode replace don't support incremental loads, while the ones with merge do.