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:
If you have just installed Snoweaver, ensure you have launched the admin console to initialize the Admin API.
Preparation
Donwlaod or Clone the Quickstart Repository to your local machine.
Navigate to the directory examples/dbtcloud
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
On your client machine, open a command-line terminal (Linux, macOS) or Git Bash (Windows) and navigate to the same directory.
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.
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:
See detailed instructions in Tutorial: Retrieve data using a web request job
Upsert and Delete Records
Sample Jobs:
sfdc_upsert_object_record
sfdc_delete_object_record
Further Reading:
See detailed instructions in Tutorial: Upsert and delete records using web request jobs
Perform Bulk Data Upload
Sample Jobs:
sfdc_bulk_ingest_object_records
sfdc_get_job_info
Further Reading:
See detailed instructions in Tutorial: Upload data using a multipart web request job
Execute a SOQL Query and Retrieve Additional Results
Sample Jobs:
sfdc_query
sfdc_query_next_batch
Further Reading:
See detailed instructions in the Tutorial: Save results and orchestrate tasks