Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

...

You can use this Snap to perform SOQL queries using Salesforce Bulk API 2.0.

Note

Multiexcerpt include macro
macro_uuid400ce58f-0da5-4a11-ae68-7d54283f17be
nameSalesforce objects limitation
templateDataeJyLjgUAARUAuQ==
pageSalesforce Batch Create
addpanelfalse



Prerequisites

Valid Salesforce OAuth 2 account with Read permissions.

...

  • 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

    Multiexcerpt include macromacro_uuid2a7efd82-95fc-4efd-a639-762be5ca0193nameSalesforce objects limitationtemplateDataeJyLjgUAARUAuQ==pageSalesforce Batch Createaddpanelfalse

Snap Views

TypeFormatNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input Document
  • Min: 0
  • Max: 1
  • Mapper Snap
  • Filter
  • Router
A document containing values required for the bulk query.
OutputDocument
  • Min: 1
  • Max: 1
  • Document to Binary
  • Salesforce Upsert

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:

  • Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

...

FieldField TypeDescription

Label*

DefaultValue:Salesforce Bulk Query
Example
: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 










Example
:41.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
Example
:"select FirstName, LastName from " + $object + " order by Name LIMIT 5"

"SELECT Name FROM Account"
"SELECT Id,Name,Phone FROM Account WHERE Id='" + $Id + "'and
Name='" + $name + "'"

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.

Note
titleUsing quotes in the WHERE clause
  • Do not use quotes for field names in the WHERE clause. Using quotes results in error.
  • Use only single quotes for values in the WHERE clause, as using double quotes results in an error.
  • The above rules do not apply when using SnapLogic expressions; you can use quotes for the field names and values as applicable. 


Max Records Per Set*

Default Value:10000
Example
:5000

Integer/Expression

Specify the number of records you want the Snap to fetch in a single set.


Maximum threads


Default Value: 10
Example: 9

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.

  • The query results are downloaded only if the Maximum Records Per Set value is greater than or equal to 10000.

  • If you expect the query results to be large, we recommend that you increase the values of the Max Records Per Set and Maximum threads for optimal performance.

  • This field does not support upstream values for Maximum threads. However, it supports values from pipeline parameters.

Minimum value: 1
Maximum value: 200

Polling Interval*

Default Value5
Example
:10

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
Maximum value: 60

Polling Timeout*

Default Value:3000
Example
:300

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
Example
: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

Default Value: Deselected

CheckboxSelect this checkbox to include deleted records in the query result. This feature is supported in Bulk API version 47.0 or later.

Match Data Type

Default ValueDeselected

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. 


Note

The Salesforce response for null values is independent of the selection of the Match Data Type checkbox.


Display null or empty values as null


Default ValueDeselected

Checkbox

Select this checkbox to display empty string or null data as null in the output preview.

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.

Info

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


Default Value
: N/A
Example: String

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.


Note

This Snap does not support Net Zero Cloud Salesforce objects.


Snap Execution

DefaultValueValidate & Execute
Example
:Execute only

String

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during Pipeline validation. Subsequently, it performs full execution of the Snap (unlimited records) during Pipeline runtime.
  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.



Multiexcerpt include macro
nameTemporary Files
pageJoin

Examples

Querying for Contacts in Salesforce Using Upstream Parameters in the Bulk Query Snap

...