Overview
The Salesforce Export script gives you the ability to connect to Salesforce and sync enhanced contacts, accounts, and other objects from Civis Platform back to Salesforce. This export script uses Salesforce API v55.0 and Bulk API 2.0 Ingest.
In order to use the Salesforce Export script, you will need a user credential and client credential for your Salesforce account. For more information on how to set up these credentials, please see the following help article: Setting Up Salesforce Credentials.
For debugging purposes, the Salesforce Export script makes the resulting log files from Salesforce API available as run outputs attached to your script run. These log files come as CSV and directly from Salesforce API without any modification by Civis Platform. Depending on your script run, one or more of the following log files may be available: successfully exported records, unprocessed records, and failed records. For details, please refer to these links to the Salesforce documentation.
Key Features
- Upsert of exported data.
- Get data from a database table to Salesforce.
- Get data from a file by file ID to Salesforce.
- Delete records on a Salesforce object.
Getting Started
You can create your script using this link, or in Platform you can navigate to Data → Exports → Salesforce.
Fill out the following parameters (required parameters are marked with a red asterisk in the template).
Parameters
- Script Mode (required): The mode for the script to run against. The options are:
- Run: Fetch Salesforce object records and write them to your destination database.
- Test connection: Test connectivity. Checks if calls can be made to Salesforce.
- List-objects: Show details of all Salesforce objects.
- Help: List all modes and the version of the export.
- Salesforce Export Mode (optional): There are two Salesforce modes that can be used:
- Upsert. This is used by default.
- Delete. If this optional is selected, the specified Platform data must have the “id” column.
- User Credential (required): A valid credential containing the appropriate username and password.
- Client Credential (required): A valid credential containing the appropriate username and password.
- Salesforce Instance URL (optional): An organization Salesforce instance, developer instance, sandbox etc.
- Salesforce Object (optional): Salesforce object to write data to, e.g., Contact.
- Maximum Row Errors (optional): Maximum number of allowed failed records before failing the job.
- Exit Job On Failure (optional): Select this parameter if you want the job to fail as soon as the number of failed records exceeds "Maximum Row Errors" (i.e., without attempting to export the remaining records -- useful when the job run would otherwise take a very long time).
- If not selected, the job attempts to export all the records and doesn't fail even when failed records are found; at the end of the job run, it fails if the number of all failed records encountered exceeds "Maximum Row Errors".
- File ID of Data to be Exported (optional): The Civis file ID to pull records from.
- Database (optional): Name of the database to pull records from.
- Database Credential (optional): Credential name to access the chosen database.
- Schema and Table (optional): Name of schema and table to pull the records from. This parameter is required if the selected export mode is "delete".
- SQL QUERY (optional): SQL query to customize what data to export, e.g., "SELECT id, foo, bar FROM scratch.contact". If provided, the column "id" must be included (either explicitly, or implicitly by "*"). If not provided, the default is the equivalent of "SELECT * FROM scratch.contact" for your specified table.
Comments
0 comments
Please sign in to leave a comment.