Overview
The Salesforce Publisher Snap is a Write-type Snap that publishes Salesforce platform event records to a given event custom sObject (Salesforce Object). Salesforce platform 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.
We do not recommend you to use Salesforce Platform events in mission-critical applications as Salesforce platform events do not guarantee message delivery or count. However, they work very well in low-key applications like sending events containing information about printer ink cartridges. Subscribers can subscribe to the events to monitor printer ink levels and place orders to replace cartridges with low ink levels.
Input and Output
Expected input: A stream of documents whose data schema is the same as the schema that is defined in the selected Platform Event custom SObject. Each 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: 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 Snaps: Any 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. |
---|---|
Output | This Snap has at most one output view. |
Error | This 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
- Ultra pipelines: Works in Ultra pipelines.
- Spark mode: Does not work in Spark mode.
Snap Settings
Label | Required. 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. |
---|---|
Service version | Required. The version number of the Salesforce service that you want to connect to. Salesforce platform event is supported in version 44.0 or later. Example: 44.0 Default value: 44.0 |
Platform event | Required. The name of the Salesforce platform event custom object. All Salesforce platform event object names end with Example: Printer_Event__e Default value: None |
Salesforce API | The Salesforce API mode. Select either Bulk API or REST API. 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: Bulk API Default value: REST API |
Batch size | Required. The batch size in records.
Example: 700 Default value: 200 |
Batch timeout | 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. Example: 60 Default value: None |
Pass through | If selected, the input document is passed through to the output view under the key Default value: Selected |
Execute during preview | Executes the Snap during the pipeline validation so that the output view can produce a preview data. Default value: Not selected |
Example
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.
Download this pipeline.