Versions Compared

Key

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

On this Page

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related InformationSee Also|Snap Pack History

Overview

The Salesforce Publisher Snap is a Write-type Snap that publishes Salesforce platform event Platform Event records to a given event custom sObject ( Salesforce Object)object. Salesforce platform eventsPlatform Events are part of Salesforce’s enterprise messaging platform and help deliver secure and scalable custom notifications within Salesforce or from external sources.

  • In Bulk API mode, the Snap publishes multiple platform event records in batches.

  • In REST API mode, the Snap publishes only one platform event record per each request , for each input document.

Note

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

Image Added

Info

Refer the Salesforce Platform Event Allocations document before configuring this Snap. 

Image Removed

Input and Output

Expected input

Prerequisites

None.

Limitations and Known Issues

  • In Salesforce 44.0, when an input document contains extra fields which are not part of the list of fields defined in a given Platform Event object, the error handling of Salesforce.com in REST API and Bulk API is different. REST API throws the error: "No such column ...". However, Bulk API ignores all extra fields and successfully publishes records as long as the mandatory fields are present.
  • 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

Support for Ultra Pipelines

Works in Ultra Pipelines.

Snap Views

TypeFormatNumber of ViewsExamples of Upstream and Downstream SnapsDescription
InputDocument
Min: 1
Max: 1
  • JSON Parser
  • Mapper
A stream of documents whose data schema is the same as the schema that is defined in the selected Platform Event custom
SObject
Salesforce objectEach document contains one Salesforce Platform Event record. The Snap supports the input schema suggest functionality that shows the input schema in the Target path of the Mapper Snap if the Mapper Snap is connected to the input view.
Expected output
OutputDocument
Min: 0
Max: 1
  • JSON Formatter
  • Mapper
 A stream of documents that contain the success field for the event record that is published, and the original field for the corresponding input record
.

Expected upstream SnapsAny Snap with a document output view. For example, JSON Parser, Mapper.

Expected downstream Snaps: Any Snap with a document input view. For example, JSON Formatter, Mapper
.

Prerequisites

None

Configuring Accounts

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Salesforce Account for information on setting up this type of account.

Configuring Views

Input

This Snap has exactly one input view. 

OutputThis Snap has at most one output view.ErrorThis Snap has at most one error view and produces documents in the view. Each document in the error view contains key/value pairs from the input view and an error message from Salesforce.com. The error message is in the value of the error key.

Troubleshooting

None

Limitations and Known Issues

In Salesforce 44.0, when an input document contains extra fields which are not part of the list of fields defined in a given Platform Event object, the error handling of Salesforce.com in REST API and Bulk API is different. REST API throws the error: "No such column ...". However, Bulk API ignores all extra fields and successfully publishes records as long as the mandatory fields are present.

Modes

Snap Settings

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

Snap Settings

Required. The version page
FieldField TypeDescription
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

Pipeline.

Service version

Default ValueSalesforce Publisher
ExampleSalesforce Publisher

Service Version*StringRequired. T

Specify the version number of the Salesforce service that you want to connect to.

Info

Salesforce platform event is supported in version 44.0 or later.

ExampleDefault Value: 44.0
Default valueExample: 44.

Platform event

0

Events*String

Specify the name of the Salesforce platform event custom

object. All Salesforce platform event

object

names end with __e

. You can select the name from the suggested list in the

dropdown.

Example: Printer_Event__e

Default value: None

Salesforce APIThe Salesforce API mode. Select either Bulk API or REST API.

drop-down menu. The supported Salesforce Events are:

  • Standard Platform events
  • Custom Platform events: User-defined read/write events. These events end with "__e".


Info

Note: There are two underscore characters in "__e"

Default Value: None
Example: Printer_Event__e

Salesforce APIDropdown list

Select the Salesforce API mode. The available options are:

  • Bulk API
  • REST API
Note

In REST API mode, the Snap publishes one record at a time and returns the results in the output. REST API is simpler and faster if the number of records to be published is small.

Example

Default Value:

Bulk

REST API

Default value

Example:

REST

Bulk API

Batch sizeRequired. The Integer

Specify the batch size in records.

Note
  • In Bulk API mode, you can enter any value between 1 and 10,000. Each input document forms one Salesforce Platform Event record to be published. The Snap stores the records in memory until the number of records reaches the specified batch size and sends the request to SFDC in a single batch. Increasing the batch size increases the amount of memory that is used during data load. Decreasing the batch size increases the number of API calls against Salesforce.

  • In REST API, the Snap can insert publish only one event record per each request regardless of the Batch size value.

Default Value: 200
Example: 700Default value: 200

Batch timeoutThe (seconds)Integer

Specify the batch timeout in seconds. The Snap sends a batch write request to SDFC when the number of input documents in the buffer reaches the given Batch size. However, sometimes, input documents may not arrive for a long time. In such cases, a Batch timeout value helps send a batch write request in a specified time interval even if the number of input documents in the buffer is less than the buffer size. 

If you set Batch timeout to 0, the Snap waits until the number of input documents in the buffer reaches the Batch size. 

Default Value: None
Example: 60Default value: None

Number of retriesThe Integer

Specify the maximum number of retry attempts in case of a network failure. 

Default value: 1
Example: 3

Default value:  1

Ensure that the local drive has sufficient free disk space to store the temporary local file.

Retry interval (seconds)The Integer
Specify the minimum number of seconds for which the Snap must wait before attempting recovery from a network failure.

ExampleDefault Value:  3 1
Default valueExample: 1 3

Pass throughIf selected, Checkbox

Select this checkbox to pass the input document is passed through to the output view under the key original. If not selected
If you deselect this checkbox, the input document is not passed and there is no original key in the output document.

Default valueValue:  Selected

Multiexcerpt include macro
name

Snap Execution

Dropdown listSOAP Execute

Multiexcerpt include macro
nameExecution_Detail_Write
pageSOAP Execute

Example

Processing Different Input Documents

This Pipeline demonstrates how the Salesforce Publisher Snap processes three different input documents. The first document is a valid record. The second document has one required field that is missing. The third document contains an extra field that is not a part of the field that is defined in the Event object. 

Image Modified

Download this pipeline.

Expand
titleUnderstanding the pipelinePipeline

The JSON Generator Snap is used to provide the input document. The input document contains different values for a printer. The input data preview is as follows:

We use the Salesforce Publisher Snap to publish the values. The following image displays the Snap configuration in REST API mode

All the expression properties in the Snap use Pipeline parameters. The following image displays the Pipeline parameters that are used in this example:

After you validate the Pipeline, you can see that the first document is successfully published in both the modes. The second input document produces an error document in the error view in both REST and Bulk API modes. The third document produces an error document in the error view in REST API, but is successfully published in Bulk API.

Following is the output preview in the Bulk API mode:

Following is the output preview of the error document in Bulk API mode:

Following is the output preview in the REST API mode:

Following is the output preview of the error document in the REST API mode:

Additional Resources

  • Glossary
  • Getting started with SnapLogic

    Downloads

    Multiexcerpt include macro
    namedownload_instructions
    pageOpenAPI

    Attachments
    patterns*.slp, *.zip


    Insert excerpt
    Salesforce Snap Pack
    Salesforce Snap Pack
    nopaneltrue