Overview
The Firstparty Salesforce Source retrieves data from a connected Salesforce instance and generates an Event for every row of data Salesforce returns.
This Salesforce Source is useful when you want to send retrieve data from Salesforce and act on that data. For example, you may want to send a conversion event to Meta Ads every time a new Salesforce Opportunity is created, or you may want to interact with an external API using a Rule and Javascript Action every time a Salesforce Lead is updated
Authentication
Create a Salesforce Connection in Firstparty to allow Salesforce data to be collected from your instance.
- Click the Connections link on the left sidebar in your Firstparty Workspace
- Click "Add Connection" and select the Salesforce Connection
- Click "Connect to Salesforce" and follow the prompts to login to Salesforce
Firstparty will maintain your Connection to Salesforce automatically, and you'll be able to use this Connection in the Source you'll create next
Setup the Salesforce Data Source
You may configure a Salesforce Data source using the Firstparty interface in your browser, or using the Firstparty API.
- Select Sources from the navigation menu in your Workspace
- Click "Add Source"
- Select the Salesforce Source
- Complete the configuration form, taking care to specify an appropriate Event Name to generate for each row of data returned from Salesforce, and a Query which defines which data to retrieve from Salesforce (read more below)
- Click "Create Source" to finish saving the Source
Data will sync according to schedule you specified in configuration, and recent generated Events will appear in the Debugger (see below)
- Select Sources from the navigation menu in your Workspace
- Click "Add Source"
- Select the Salesforce Source
- Complete the configuration form, taking care to specify an appropriate Event Name to generate for each row of data returned from Salesforce, and a Query which defines which data to retrieve from Salesforce (read more below)
- Click "Create Source" to finish saving the Source
Data will sync according to schedule you specified in configuration, and recent generated Events will appear in the Debugger (see below)
Writing a custom Salesforce Object Query Language Query
Firstparty will use the SOQL query specified in the Source options in order to choose which data to retrieve from Salesforce.
You may provide a custom query to retrieve any data from your Salesforce instance, or you may select from a list of example queries written by Firstparty, which will apply to most Salesforce instances.
Read SOQL Documentation on Salesforce.com
Specifying Dates in a SOQL Query
In order to limit retrieved data to only resources which were created or changed since the last time Firstparty retrieved data from Salesforce, you may use two placeholder values in your query which Firstparty will automatically replace with the appropriate date of either the current time or the last time the query was executed.
Including {{now}}
in your query will ensure that a properly formatted datetime value of the current time will be inserted into your SOQL query when Firstparty executes the query.
Including {{bookmark}}
in your query will ensure that a property formatted dateime value of the last time Firstparty retrieved data from Salesforce into your SOQL query when Firstparty executes the query.
Debugging
Recent Events retrieved from Salesforce will be displayed in the Debugger tab within the Salesforce Source you've just configured in your Firstparty Workspace.