Sync Salesforce contacts to SQL Server

Recipe ToolsCRMMarketingDatabase

What it does

When a scheduled interval arrives, this automation searches Salesforce for new and updated contacts using a SOQL query. It inserts each contact record into a SQL Server database table, including linked account details when available.

Who it's for

Data and analytics teams who need Salesforce contacts synced to a database on a regular schedule.

How teams use this

Keep a contact database in sync

Sync Salesforce contacts to SQL Server on a daily schedule so the database always reflects the latest contact information. The team can query the database without hitting Salesforce API limits.

Add account context to each row

When a contact has a linked account, include the account details in the database row so analysts can join contacts to their parent accounts. This requires the account lookup step to run only when Account ID is present.

Sync to a different database table

Point the insert step to a different SQL Server table or database so multiple teams can maintain their own contact copies. The query and schedule stay the same.

How it works

  1. Run on a set schedule. This automation starts at the interval someone configures, such as every hour or every day.
  2. Search for new and updated contacts. Query Salesforce for contacts using a SOQL WHERE clause to find records that match the sync criteria and retrieve all matching contact data.
  3. Retrieve account details when linked. For each contact with an Account ID present, search Salesforce for that account so the full account context is available for the database row.
  4. Insert contact into SQL Server. Insert each contact record into the dbo.SS_Demo_Contacts table in SQL Server with the Salesforce data and linked account information when present.