Salesforce Batch Create

Overview

The Salesforce Batch Create Snap enables you to create multiple Salesforce object records in each Salesforce REST API request.

Note: To use newer Salesforce objects, use the latest API versions where those objects are available.


Supported Accounts

Prerequisites

  • A valid Salesforce account with the required permissions.
  • The composite/tree resource should be enabled for your Salesforce account credential.

Snap views

Type Description Examples of upstream and downstream Snaps
Input

This Snap has exactly one document input view - a stream of documents. The following example shows a list of two documents for Account SObject records. The first document has two nested Contact records, and the second document has one nested child Account record and one nested Contact record. Therefore, this stream of documents should insert a total of 6 records (3 Account records and 3 Contact records):

[ { "attributes": { "type": "Account", "referenceId": "ref1" }, 
"name": "SampleAccount1", "phone": "1234567890", 
"website": "www.salesforce.com", "numberOfEmployees": "100", 
"type": "Analyst", "industry": "Banking", 
"Contacts": { "records": [ { "attributes": { "type": "Contact", "referenceId": "ref2" }, "lastname": "Smith", "Title": "President", "email": "[email protected]" }, { "attributes": { "type": "Contact", "referenceId": "ref3" }, "lastname": "Evans", "title": "Vice President", "email": "[email protected]" } ] } }, 
{ "attributes": { "type": "Account", "referenceId": "ref4" }, "name": "SampleAccount2", "phone": "1234567890", "website": "www.salesforce.com", "numberOfEmployees": "52000", "type": "Analyst", "industry": "Banking", "childAccounts": { "records": [ { "attributes": { "type": "Account", "referenceId": "ref5" }, "name": "SampleChildAccount1", "phone": "1234567890", "website": "www.salesforce.com", "numberOfEmployees": "100", "type": "Analyst", "industry": "Banking" } ] },
"Contacts": { "records": [ { "attributes": { "type": "Contact", "referenceId": "ref6" }, "lastname": "Jones", "title": "President", "email": "[email protected]" } ] } } ]
Output

This Snap has at most one document output view.

A stream of resulting documents, each of which contains the "id" field for the record created and the "original" field for the corresponding input record.

Learn more about Error handling.

Examples

Creating Multiple Records: Create multiple records in one REST API request.

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description
Label*

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.

Default value: Salesforce Batch Create

Example: Salesforce_Batch_Create

Service Version*

String/Expression/ Suggestion
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 value: 52.0

Example: 41.0

Batch Size*

Integer
Specify the number of records batched per request. If the input has 100,000 records, and the batch size is set to 200, the total number of requests would be 500.

The maximum allowed batch size is 200.

Default value: 200

Example: 200

Auto-generated Reference ID

Checkbox
Each record in the input document should contain a reference Id field, which should have a unique value so that each item in the result can be correlated to an input record. Select this checkbox to enable the Snap to automatically generate and overwrite the reference Id values.

Default value: Selected

Nested Records

Checkbox
Select this checkbox if input documents are expected to have nested records. If input documents are not nested and this property is selected, the Snap will function as expected with small performance penalty. If input documents are nested, but this property is not selected, the Snap will fail to correlate results to the corresponding input documents and will throw an error.

Default value: Deselected

Pass Through

Checkbox
Select this checkbox to pass the input document to 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

Snap execution

Dropdown list
Choose 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.