Salesforce Setup Guide

The Salesforce example folder in the Quickstart repository includes all the Salesforce jobs used in the tutorials. To simplify the setup process and bypass the manual steps, you can follow this guide to create a project and import all the jobs via the command line.

Prerequisites

Before continuing with this guide, ensure you have completed the following prerequisites:

Preparation

  1. Donwlaod or Clone the Quickstart Repository to your local machine.

  2. Navigate to the directory examples/dbtcloud

  3. Open the setup.sh file in a text editor to update the following variables, or alternatively, set their values using environment variables:

    • CONN Specify the Snowsql connection for the Snowflake account, ensuring it points to database: SNOWEAVER and schema: LEARN_DEV. Verify that the role associated with this connection has the required privileges to execute the commands in setup.sql. Ideally, use the AccountAdmin role or an equivalent role in a sandbox environment.

    • USER The Snowflake user defined in the Snowsql connection.

    • OAUTH_CLIENT_ID Your Salesforce OAuth consumer key.

    • OAUTH_CLIENT_SECRET Your Salesforce OAuth consumer secret.

    • OAUTH_REFRESH_TOKEN Your Salesforce OAuth refresh token.

    • SFDC_ACCOUNT Your Salesforce Org account, e.g., snoweaver-dev-ed.develop.

Set up the sample project

  1. On your client machine, open a command-line terminal (Linux, macOS) or Git Bash (Windows) and navigate to the same directory.

  2. Execute the following command to set up the example project:

    bash setup.sh
    

    Note

    If the LEARN_DEV project already exists, all its resources will be deleted, with the exception of the DATA stage and the RESULTS table.

    To retain your data, you can remove the -d flag from the ‘sw import all -c ${CONN} -d’’ command in the setup.sh script.

    Alternatively, use the Snoweaver CLI to create a backup of the project’s contents.

  3. After the execution completes, you can access the sample jobs in the LEARN_DEV project.

Retrieve Object Data

Sample job:

  • sfdc_get_object_data

Further Reading:

Upsert and Delete Records

Sample Jobs:

  • sfdc_upsert_object_record

  • sfdc_delete_object_record

Further Reading:

Perform Bulk Data Upload

Sample Jobs:

  • sfdc_bulk_ingest_object_records

  • sfdc_get_job_info

Further Reading:

Execute a SOQL Query and Retrieve Additional Results

Sample Jobs:

  • sfdc_query

  • sfdc_query_next_batch

Further Reading: