Salesforce Bulk Query
In this article
Overview
You can use this Snap to perform SOQL queries using Salesforce Bulk API 2.0.
To use newer Salesforce objects, use the latest API versions where those objects are available.
Prerequisites
Valid Salesforce OAuth 2 account with Read permissions.
Support for Ultra Pipelines
Works in Ultra Pipelines.
In Ultra Pipelines, set the Batch Size as 1 for the Snap to process one document/record at a time.
Limitations
- This Snap performs batch processing; a batch of input documents is processed for each HTTP request sent to Salesforce. Values of all the expression-enabled fields must remain constant during the Snap execution or validation. Hence, all expression fields can support Pipeline parameters only when they are expression-enabled. The input data parameters are not supported for expression fields; for example, $serviceVersion.
Can execute up to 10,000 query jobs in a 24-hour rolling window.
Can store up to 1TB of query results in a 24-hour rolling window.
- Supports Salesforce Bulk Query service version 47.0 and above.
SOQL queries do not support the following commands:
COUNT
ROLLUPSUM
GROUP BY CUBE
OFFSET
Nested SOQL queries
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| A document containing values required for the bulk query. |
Output | Document |
|
| A document containing the results of the query performed by the Snap. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
Snap Settings
Asterisk (*): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon (): Indicates that you can add fields in the field set.
Remove icon (): Indicates that you can remove fields from the field set.
Field | Field Type | Description |
---|---|---|
Label* DefaultValue:Salesforce Bulk Query | String | Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline. |
Service Version* Default Value:52.0 | String/Expression/Suggestion | Specify the version number associated with the Salesforce service you want to connect to. Alternatively, click the Suggestion icon to fetch the list of versions and select the desired version. |
SOQL Query* DefaultValue: None
| String | Specify the query in SOQL format. You can enter a JavaScript expression that is evaluated each time the Snap is executed. As in the second example below, on each document received from the input view, the % symbols will be replaced with the value pointed to by the JSON path $.Id in the input data. Using quotes in the WHERE clause
|
Max Records Per Set* Default Value:10000 | Integer/Expression | Specify the number of records you want the Snap to fetch in a single set. |
Maximum threads Default Value: 10 | Integer/Expression | Specify the maximum number of threads to download query results simultaneously in multiple threads. The Snap uses the thread pool to download the query results.
Minimum value: 1 |
Polling Interval* Default Value: 5 | Integer/Expression | Specify the number of seconds you want the Snap to wait between two queries. At each polling interval, the Snap checks the Bulk API query batch processing status. Minimum value: 1 |
Polling Timeout* Default Value:3000 | Integer/Expression | Specify the number of seconds into the query batch execution before the query fails if it receives no response. If the timeout occurs while waiting for the completion of the query batch execution, the Snap throws a SnapExecutionException. Minimum value: 10 |
Maximum Retry Attempts Default Value: 5 Example: 1 | Integer/Expression | Specify the maximum number of retry attempts the Snap must make in case of a network failure. Minimum value: 1 |
Retry Interval (seconds) Default Value:3 | Integer/Expression | Specify the minimum number of seconds the Snap must wait before attempting recovery from a network failure. Minimum value: 0 |
Include Deleted Records | Expression/Checkbox | Select this checkbox to include deleted records in the query result. This feature is supported in Bulk API version 47.0 or later. This field supports input values from the upstream Snap. However, it does not support pipeline parameters.
|
Match Data Type Default Value: Deselected | Checkbox | Select this checkbox to match the data types of the bulk query job results. On selecting this checkbox, the Snap converts string values to the corresponding data types if the original data type is one of Boolean, Integer, Double, Currency, and Percent. The Salesforce response for null values is independent of the selection of the Match Data Type checkbox. |
Display null or empty values as null
| Checkbox | Select this checkbox to display empty string or null data as When you deselect this checkbox, the Snap displays an empty string or null data as blank in the output preview. For a better understanding, refer to this Example. The output in the Salesforce application remains unaffected. Regardless of the state of the checkbox (selected or deselected), the Salesforce record and its corresponding output continue to appear empty, as shown below: |
Object Type
| String/Expression | Appears on selecting the Match Data Type checkbox. Specify the object type to match. Alternatively, select an object type from the suggestions list to match the data type. This Snap does not support Net Zero Cloud Salesforce objects. |
Snap Execution DefaultValue: Validate & Execute | String | Select one of the three modes in which the Snap executes. Available options are:
|
Troubleshooting
Error | Reason | Resolution |
---|---|---|
Invalid value: 201 | The Maximum thread value is larger than the required maximum, which is 200. | Provide 200 or a value lesser than 200 (maximum value) in the Maximum threads field. |