In this article
***This feature is available only to those Salesforce users that have the access to the Limited Release of the Salesforce Batch Create functionality.
The Salesforce Batch Create Snap is a Write-type Snap that enables you to create multiple Salesforce object records in each Salesforce REST API request.
The SObject Tree resource is available through a pilot program in the service version 43.0, which is the latest as of October, 2015. If you want to use this Snap in the service version 43.0, you should ask your Salesforce.com support to enable the SObject Tree resource for your account. It will be generally available in the versions later than 43.0. |
A valid Salesforce account with the required permissions.
The composite/tree resource should be enabled for your Salesforce account credential.
Works in Ultra Pipelines.
None.
View Type | View Format | Number of Views | Examples of Upstream and Downstream Snap | Description | |
---|---|---|---|---|---|
Input | Document |
|
| 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 records. Therefore, this stream of documents should insert total of 6 records (3 Account records and 3 Contact records):
| |
Output | Document |
|
| 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. An example of the expected output is attached below (Salesforce_Batch_Create_Output.json. | |
Error | Document |
| N/A | The error view contains error, reason, resolution and stack trace. For more information, see Handling Errors with an Error Pipeline. |
Field | Field Type | 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 | ||
Service Version* | String/Expression/Suggestion |
| ||
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 | ||
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: Not selected | ||
Pass Through | Checkbox | 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 | ||
Snap Execution | Dropdown list |
|
The following example Pipeline of Salesforce Batch Create Snap shows how multiple records are created in Salesforce using Salesforce Batch Create.
Download the Pipeline and the sample input file for the File Reader Snap.
In the Pipeline execution:
A JSON Generator Snap is used to provide object records to a Salesforce object (in this case, to the Account object).
The Salesforce Batch Create Snap creates and adds all the records to the Account object:
Successful execution of the Snap gives the following preview: