Tutorial: Retrieve data using a web request job
This tutorial provides step-by-step instructions to configure and execute a Web Request - GET job to retrieve object data from Salesforce.
For details on the REST API endpoints used in this tutorial, please refer to the following documentation pages:
Prerequisites
Before continuing with this tutorial, ensure you have completed the following prerequisites:
Create a web request GET job
Open the LEARN_DEV project in Snoweaver with the LEARN_DEV_DEVELOPER role.
Open the Jobs page.
Apply the following configuration:
Name: sfdc_get_object_data Job Type: Web Request Instance Type: Procedure Request Type: GET Response Format: Json External Integration: sfdc_learn_dev_access_integration Enable Headers: checked Secrets: Alias: token Secret: sfdc_learn_dev_oauth_access_token
Specify the following job vairables:
Name
Type
Test Value
object
Text
Account
id
Text
Use the following Jinja template for specifying the job endpoint URL:
https://{{_proj.sfdc_account}}.my.salesforce.com/services/data/v61.0/sobjects/{{_vars.object}}/{{_vars.id}}
Test the template to validate the output.
Use the following Jinja template for specifying the job headers:
{ "Authorization":"Bearer {{_secrets.token}}" }
Test the template to validate the output.
Test and save the job
Execute the job
Click Build to build a job instance.
Open a Snowflake worksheet and execute the following SQL statements to call the job instance:
USE ROLE LEARN_DEV_DEVELOPER; CALL SNOWEAVER.LEARN_DEV.SFDC_GET_OBJECT_DATA('ACCOUNT','');
This procedure returns the Account metadata encapsulated within a variant value.
Returning to the Jobs page in Snoweaver.
Locate the Instance Type setting and select Function from the available options.
Save the job.
Run the Build process again.
Open your web browser and go to Salesforce.
In the Sales Console, type “sForce” into the the global search bar at the top of the screen.
Open the sForce Account.
In the address bar, find the record ID and copy it.
Return to the Snowflake worksheet and execute the following statements.
SELECT SNOWEAVER.LEARN_DEV.SFDC_GET_OBJECT_DATA('ACCOUNT','<sForce Id>');
The SQL statement executes the job and retrieves specific details for the indicated account.