Versions Compared

Key

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

On In this pagearticle

Table of Contents
maxLevel2
absoluteUrltrue

Overview

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

Note

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

Image Added

Prerequisites

Valid Salesforce OAuth 2 account with Read permissions.

...

  • This Snap performs batch processing, that is, ; a batch of input documents are 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

View TypeType of ViewFormatNumber 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

Document

  • Min: 1

  • Max: 1

N/A

The error view contains error, reason, resolution and stack trace. For more information, see Handling Errors with an Error Pipeline.

Snap Settings

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.

Snap Settings

Info
  • Asterisk (*): Indicates a mandatory field.

  • Suggestion icon (Image Added): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon (Image Added): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon (Image Added): Indicates that you can add fields in the field set.

  • Remove icon (Image Added): Indicates that you can remove fields from the field set.


 Salesforce Bulk QueryService Version* Salesforce Bulk QuerySOQL Query*Polling Timeout*Integer 1 for which Snap Execution
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

that

you want to connect to. Alternatively, click the Suggestion Image Modified icon to fetch the list of versions and select the desired version.

SOQL Query*

DefaultValue:  52.0 
Example41.0

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 , which 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.
Example:

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


Note
titleUsing quotes in the WHERE clause
  • Do not use quotes for field names in the WHERE clause. Using quotes results in an 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 you are using SnapLogic expressions, ; you can use quotes for the field names and values as applicable. 

Default value

Default Value: [None]
Example"select FirstName, LastName from " + $object + " order by Name LIMIT 5"


Max Records Per Set*Integer

Max Records Per Set*

Default Value:10000
Example
:5000

Integer/Expression

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


Maximum threads


Default Value:

 10000
Example:5000

Polling Interval*

Integer

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 for which you want the Snap to wait between two queries. At each polling interval, the Snap checks the status of the Bulk API query batch processing status.

Minimum value: 1
Maximum value: 60Default

Polling Timeout*

Default Value: 53000
Example
:10

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 Default


Maximum Retry Attempts


Default 
Value
30005
Example: 
3001
Maximum Retry AttemptsInteger/Expression

Specify the maximum number of retry attempts that the Snap must make in case of a network failure. 

Minimum value: 1

Multiexcerpt include macro
nameretries
pageFile Reader

Default Value5
Retry Interval (seconds)

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

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.

Info

This field supports input values from the upstream Snap. However, it does not support pipeline parameters.

  • When you select the checkbox and enable the expression, the string value is displayed as true:
    Image Added

  • When you deselect the checkbox and disable the expression, the string value is displayed as false:
    Image Added


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 Value

1
Example: 3

Deselected

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: 

Image Added


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.

Default ValueValidate & Execute
ExampleExecute only

...


...

Troubleshooting

ErrorReasonResolution
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.


Multiexcerpt include macro
nameTemporary Files
pageJoin

Examples

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

...

Understanding the Pipeline

  1. You build Build the above Pipeline using the JSON Generator and Salesforce Bulk Query Snaps.

  2. You configure Configure the JSON Generator Snap to send Contact as the type of data that you want to retrieve.


  3. You add Add the details associated with your bulk query request in the Salesforce Bulk Query Snap. This must include your account credentials.

    In this example, you are looking to receive the first and last names of the first five contacts in your Salesforce database.

  4. You save Save the Pipeline and validate it. Successful validation displays the data you requested.

Download this Pipeline.

Downloads

...

Important Steps to Successfully Reuse Pipelines

...

Download and import the Pipeline into SnapLogic.

...

Configure Snap accounts as applicable.

...

Multiexcerpt include macro
namedownload_instructions
pageOpenAPI

Attachments
patterns*.slp, *.zip

See Also

...

Related Content

...