Salesforce Update

In this article

Overview

Salesforce Update is a Write-type Snap that enables you to update object records in Salesforce in Bulk API 1.0 or REST API mode. Salesforce Poller Snap checks the result of the batch job when in Bulk API mode Snap submits the batch job and writes the batch job information to the output view. In the REST API mode, the Snap updates record to the Salesforce object and returns results synchronously without the need for the Salesforce Poller Snap.

  • The ID field is required. This Snap updates records only by record ID and not by its external ID.
  • To use newer Salesforce objects, use the latest API versions where those objects are available.

Salesforce Update Settings

Prerequisites

None.

Support for Ultra Pipelines

Works in Ultra Task Pipelines.

Limitations

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

Snap Views

TypeFormatNumber of ViewsExamples of Upstream and Downstream SnapsDescription
InputDocument
  • Min: 1
  • Max: 1
  • Salesforce Delete
  • Mapper
Each document contains Map data for an object ID and records of field and value pairs.
OutputDocument
  • Min: 1
  • Max: 1
  • Copy
  • Mapper
Each document contains Map data that includes the Job ID, Batch ID, URL, and an array of records if it is in Bulk API mode.
If it is executed in REST API mode, each document contains input data and a key-value pair of created: false for each successfully updated record.
ErrorDocument
  • Min: 1

  • Max: 1

N/A

This Snap produces documents in the view if the input data causes an error in REST API. Each document contains the record ID and an error message from Salesforce.com.
If the Snap is in Bulk API, a similar set of data is available in the error view of the Salesforce Poller Snap connected to this Snap directly or indirectly.

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

Snap Settings

Field

Field TypeField Dependency

Description

Label*


StringNone

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 Update
ExampleSalesforce Update

Service Version*


String/Expression/SuggestionNone

Specify the version number associated with the Salesforce service that you want to connect to. Alternatively, click the Suggestion  icon to fetch the list of versions and select the desired version.

Default Value52.0 
Example41.0


Batch Size*

Integer/ExpressionNone

Specify the number of records to be processed in a batch.

In Bulk API, this value is allowed to be from 1 through 10,000. Each input document forms one Salesforce record to be updated. The Snap stores record in memory until the number of records reaches the batch size and sends the request to SFDC in a single batch. Increasing the batch size increases the amount of memory used during the data load. Decreasing the batch size increases the number of API calls against Salesforce.

In REST API, the Snap can update only one record per each request regardless of the Batch Size.

Default Value: 200
Example: 200, 10000

Object Type*
 

String/Expression/SuggestionNone

Specify the name of the Salesforce object or select one from the suggested list.

This Snap does not support Net Zero Cloud Salesforce objects.

Default ValueAccount
ExampleAccount

Salesforce API


Dropdown listNone

Set the Salesforce API mode to Bulk API or REST API. The Snap in REST API mode creates one record at a time and returns the results at the output. REST API can be simpler and faster if the number of records to be created is small (a few).

Default Value: Bulk API
Example: REST API

Null Setting with Bulk APICheckboxNone

Select this checkbox to set the nullable fields to null in the Salesforce object if there are null values in the input document. This field works only if you select Bulk API mode in the Salesforce API field.

Default Value: Deselected
Example: Selected

Related Object



String/Expression/SuggestionNone

Enter or select a related parent object. This field does not affect the Snap operation on records in Salesforce. It is provided for the property suggest and the input schema suggests only. 

Default Value: [None]
ExampleAccount_r

Apply active assignment rulesCheckboxAppears when you select REST API from the Salesforce API dropdown and when the Object Type is Account, Case, or Lead.

Select this checkbox to apply the active assignment rules for the selected object type (AccountCase, or Lead).

If you deselect this checkbox, active assignment rules are not applied for the selected object type (AccountCase, or Lead).

Default Value: Selected

Related External ID


String/Expression/SuggestionNone

Enter or select an external ID of the selected related parent object. This property does not affect the Snap operation on records in Salesforce. It is provided for the property suggest and the input schema suggests only. 

Default Value:   [[None]]
Example:  AccountNumber__c

Bulk API Serial mode


CheckboxNone

Select this checkbox to allow the Bulk API to run in serial mode.
Deselect this checkbox to allow the Bulk API to run in Batch mode. This is applicable only for BULK API. 

Default Value: Not selected (Batch mode)

Standardize Error Output


CheckboxNone

Select this checkbox to enable the Snap to produce the error output with Reason, Original, Stack trace and Resolution.
Deselect this checkbox to display the input document along with the error message in the output view.

Default Value:  Not selected

Pass Through


CheckboxNone

Select this checkbox to pass the input document the output view under the key 'original'.

If you deselect this checkbox, the input document will not be passed and there is no "original" key in the output document.

Default Value:  Selected

For Bulk APIs, if you select this checkbox and if the Batch size is equal to 1, the input document is passed to the output view under the key original. If the Batch size is greater than 1, the list of input documents is displayed under Records and the input document is not included under the original key.

Snap Execution


Dropdown listNone

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

  

If you want to get the resulting status for each record to be updated in Bulk API mode, you must connect a Salesforce Poller Snap after the Salesforce Update Snap.

Examples


Update a New Record

The following example Pipeline demonstrates how to update a new record in a Salesforce object.

First, configure the Mapper Snap to map the Object record details (that need to be updated using record ID) to the input view of Salesforce Update Snap: 

The Salesforce Update Snap updates the record (using its ID) in the Account object:  



Successful execution of the Snap gives the following preview:

The Pipeline, available in the Downloads section, uses several Salesforce Snaps to perform create, update, delete, and lookup actions on Salesforce object records.

Downloads

Important Steps to Successfully Reuse Pipelines

  1. Download and import the Pipeline into SnapLogic.

  2. Configure Snap accounts as applicable.

  3. Provide Pipeline parameters as applicable.


  File Modified

File salesforceTest_2014_04_15.slp

Mar 16, 2017 by Diane Miller

Snap Pack History

 Click to view/expand
Release Snap Pack VersionDateType  Updates
August 2024438patches28607 Latest

Fixed an issue with the Salesforce Publisher Snap where an invalid session triggered infinite retries, resulting in many open file descriptors that eventually crashed the node.

August 2024438patches28040 Latest

Fixed an issue with the Salesforce SOQL Snap where the URL encoding was improperly applied to sandbox instance URLs. Now, the Snap ensures URL sandbox instance URLs are properly encoded.

Breaking change from Salesforce

Salesforce is retiring some of the hostnames for non-enhanced domains from August 2024:

  • Redirections for legacy (non-enhanced) hostnames stop in production orgs and demo orgs. Production orgs get this release starting in January 2025.

  • Redirections for legacy (non-enhanced) hostnames stopped in sandboxes, Developer Edition orgs, patch orgs, scratch orgs, and Trailhead Playgrounds.

When deploying a new My Domain, including enhanced domains, Salesforce automatically redirects previous URLs. For detailed information, such as hostname formats for legacy (non-enhanced) domains, refer to the Prepare for the End of Redirections for Non-Enhanced Domains.

To align with Salesforce’s redirection changes for non-enhanced domains, the classic URL format (https://snaplogic--devqa.my.salesforce.com/) is no longer supported for Sandbox environments. As a result, any existing Salesforce pipelines using classic URLs will stop functioning as before.

Workaround

To run your pipelines successfully, you must append sandbox to your classic URLs: https://snaplogic--devqa.sandbox.my.salesforce.com/

Learn more about the enhanced domains deployment by Salesforce.

August 2024main27765 StableUpgraded the org.json.json library from v20090211 to v20240303, which is fully backward-compatible.
May 2024437patches27307 Latest

Fixed authentication issues with the Salesforce Subscriber Snap in the Ultra Pipeline to ensure the Snap reauthenticates and reconnects as expected.

May 2024

main26341

 

Stable

Updated and certified against the current SnapLogic Platform release.

February 2024436patches25626 LatestEnhanced the Salesforce Bulk Create, Bulk Delete, Bulk Query, Bulk Update, and Salesforce Bulk Upsert Snaps to include the complete error details under the original object that contains the copies of the failed input records.
February 2024436patches25192 Latest

Fixed an issue with the Salesforce Mutual Authentication Account where the 8443 port was not used while authorizing the account. Now, the access token request uses the 8443 port for authorizing the Mutual Authentication Account.

Breaking change