In this article
Table of Contents | ||||
---|---|---|---|---|
|
Snap type: | Read | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: | Salesforce Lookup provides the ability to format WHERE clause from input document stream for a SOQL (Salesforce Object Query Language) query. See Introduction to SOQL and SOSL for more information. | |||||||||||||||
Prerequisites: | [None]
| |||||||||||||||
Support and limitations: | Works in Ultra Pipelines. | |||||||||||||||
Account: | This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring Salesforce Accounts for information on setting up this type of account. | |||||||||||||||
Views: |
| |||||||||||||||
Settings | ||||||||||||||||
Label*
| 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. Default Value: Salesforce Lookup | |||||||||||||||
Service Version* | | |||||||||||||||
Salesforce API* | This property sets the Salesforce API mode to Bulk API or REST API during the pipeline execution. In preview mode, the Snap always executes in REST API. | |||||||||||||||
Object typeType* | Specify the object type that enables you to define the name of the Salesforce object, such as Account. | |||||||||||||||
Output fieldsFields* | Enter a list of field names for the SOQL SELECT statement. Each entry in the table property can be selected from the suggest list or can be an expression to be evaluated with the values from the input view. | |||||||||||||||
Conditions* | This table property forms an AND clause in the SOQL WHERE statement. Each entry in the table property can be an expression to be evaluated with the values from the input view. The Snap receives a stream of document data, where each document is formatted into an AND clause and all AND clauses are ORed together to form an entire WHERE statement. If the size of SOQL statement exceeds 10,000 characters, the Snap sends the SOQL query request, retrieves the resulting records which are sent to the output view, and restarts forming a new WHERE statement.
Default value: [None]
| |||||||||||||||
Correlation ID | This property is an ID field name which the Snap uses to correlate input document to the output record when users want to pass through input data to the output view. The value for this property can be selected from the suggest list. The value of this ID field name should be unique throughout the entire records in the selected object type, and therefore identifies a specific record in an SObject type. External ID field names fit into this category. This property may be left empty if users do not want to pass through input document to the output view. Example: Id
| |||||||||||||||
Single lookup requestLookup Request* | Select this checkbox to enable the Snap to send one lookup request for each input document. Default valueValue: Not selected | |||||||||||||||
Polling | timeoutInterval* | This property allows | you toto define the polling | timeoutinterval in seconds for the Bulk API | read batchquery execution. | If the timeout occurs while waiting for the completion of the read batch execution, the Snap throws a SnapExecutionException.At each polling interval, the Snap checks the status of the Bulk API query batch processing. Maximum value:: 60 Default Value: | 3000:5 Example: | 3005 | ||||||||
Polling intervalTimeout*
| This property allows to you to define the polling interval timeout in seconds for the Bulk API query read batch execution. At each polling interval, the Snap checks the status of the Bulk API query batch processing. | |||||||||||||||
Process dateDate/timeTime
| All date/time fields from Salesforce.com are retrieved as string type. If this property is unchecked, the Snap sends these fields without any conversion. If checked, the Snap converts date/time fields to corresponding date/time types by accessing the meta data of the given SObject. Salesforce datetime is converted to Joda DateTime, Salesforce date to Joda LocalDate and Salesforce time to Joda LocalTime. | |||||||||||||||
Include deleted recordsDeleted Records
| Select this checkbox to include deleted records in the query result. This feature is supported in REST API version 29.0 or later and Bulk API version 39.0 or later. Default Value: Not selected | |||||||||||||||
Pass-through on no lookup matchNo Lookup Match | When there is no lookup matching an input document, the input document will pass through to the output view if this property is selected. Otherwise, it will be written to the error view as an error condition. Default Value: Not selected
| |||||||||||||||
Match data typeData Type
| Select this checkbox to match the data types of the Bulk API results with the data types in REST API. This property applies if the content type is not JSON in Bulk API. In Bulk API, Salesforce.com returns all values as strings if Bulk content type is XML or Batch size is for PK Chunking. If this property is checked, the Snap attempts to convert strings values to the corresponding data types if the original data type is one of boolean, integer, double, currency, and percent. This property is ignored in REST API or with JSON Bulk content type. In Bulk API (not with JSON Bulk content type), Salesforce.com does not return any value for null. Therefore, if the value is null, the key-value entry is not present in the output document, which is different from the REST API result. Default Value: Not selected | |||||||||||||||
Snap Execution |
|
Insert excerpt Salesforce Batch Create Salesforce Batch Create nopanel true
Example
Looking up Records
In the following example Pipeline, the Salesforce Lookup Snap shows how Salesforce object records can be looked up:
In the pipeline execution:
- The Mapper Snap is used to map an account number to the AccountNumber field of a Salesforce object record.
- The Salesforce Lookup Snap queries the Salesforce Object Account for the provided account number and specifies that the output to contain only the BillingStreet value:
Successful execution of the Snap gives the following preview:
Looking-up Records with REST API Using the Correlation ID
In this Pipeline, we read data from the Salesforce Read Snap using filter condition in WHERE clause, take the first 10 rows of data in Head Snap and pass those values in the Salesforce Lookup Snap using the Correlation Id property.
The Salesforce Read Snap reads the data from the SObject type Account, with the desired output fields as Name, Id, BillingCity and AccountNumber.
The output preview of the Salesforce Read Snap:
The Head Snap reads the first ten documents starting from 0, and the output preview is as displayed:
The values are passed from the Head Snap to the Salesforce Lookup Snap. The Salesforce Lookup Snap with the output fields, Id, Name and Type, and Id, given as the where condition.The Correlation ID has been set to the Id.
Successful execution of the pipeline displays the below output preview:
Looking-up Records with a Single Lookup Request
In this Pipeline, the Salesforce Read Snap reads the records from an object, maps the value of an ID, and passes the values to the Salesforce Lookup Snap.
The Salesforce Read Snap retrieves the records for the object, Account _c.
The Mapper Snap maps the values of the ID for the Account_c object and passes them to the Salesforce Lookup Snap.
The Salesforce Lookup Snap retrieves the data from the object, for the specified output fields and generates a SQL statement based on the condition ""Id = '" + $Id + "'".
The Successful execution of the pipeline displays the below output preview.
Looking-up Records Using Correlation ID
In this Pipeline, the Salesforce Read Snap reads the records from an object, maps the value of an ID, and passes the values to the Salesforce Lookup Snap.
The Salesforce Read Snap retrieves the records for the object, Account _c.
The Mapper Snap maps the values for the ID and the custom field, '$Customer_enq__c' for the object, Account_c, and passes them to the Salesforce Lookup Snap.
The Salesforce Lookup Snap retrieves the data from the object, for the specified output fields and generates a SQL statement based on the condition ""Id = '" + $Id + "'". selecting the custom field ($Customer_enq__c) as correlation ID,
The successful execution of the pipeline displays the below output preview:
Attachments | ||||||
---|---|---|---|---|---|---|
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|