Salesforce actions

This page describes all actions available in Connect for the Salesforce component.

Query action

A query action executes a Salesforce Object Query Language (SOQL) query that may return many objects. Each resulting object is generated individually. Use SOQL to search your organization’s Salesforce data for specific information. SOQL is similar to the SELECT statement in the widely used Structured Query Language (SQL) but is designed specifically for Salesforce data. An action allows you to interact with your data using SOQL. If the query does not find any data, an empty object is returned.

Query action

Input fields description

Include deleted

A checkbox, which if selected, includes deleted records in the result list.

Optional batch size

A positive integer specifying batch size. If no batch size is specified then results of the query will be generated individually. Otherwise, query results are generated in an array of maximum batch size.

Allow all results to be returned in a set

A checkbox, which if selected, allows query results to be generated in a single array. The Optional batch size option is ignored in this case.

SOQL query

Input field where the SOQL query should be entered. For example, "SELECT ID, Name from Contact where Name like 'John Smi%'"

Max fetch count

Limit for a number of messages that can be fetched. When the variable is not set, the default value is 1,000.

Create object action

Creates a new Selected Object. This action creates a single object.

  • The input metadata is fetched dynamically from your Salesforce account.

  • The output metadata is the same as the input metadata, so you may expect all fields that you mapped as input to be returned as output.

Create Object action
In case of an Attachment object type you should specify Body in base64 encoding. ParentId is a Salesforce ID of an object (Account, Lead, Contact) which an attachment is going to be attached to.

Input fields description

Object

Input field to choose the object type you want to find. For example, Account

Utilize data attachment from previous step (for objects with a binary field)

A checkbox, which if selected, and the input message contains an attachment and the specified object has a binary field (type of base64), then the input data is placed into object’s binary field. In this case, any data specified for the binary field in the data mapper is discarded.

This action automatically retrieves all existing fields of the chosen object type available in your Salesforce organization.

Delete object action (at most 1)

Deletes an object by a selected field. You can filter by either unique fields or all fields of that object. The input metadata is fetched dynamically from your Salesforce account.

Delete Object action (at most 1)

Input field description

Object

Choose the object type you want to find from this dropdown list. For example, Account.

Type of search

dropdown list with two values: Unique Fields and All Fields.

Lookup by field

Dropdown list with all fields on the selected object. If either (or both) of the following options is set, then all searchable fields (both custom and standard) are available for selection.

All fields

If this is chosen for Type Of Search, or with all fields on the selected object where type is id or unique is true.

Unique fields

If this is chosen for Type Of Search,

id

string, salesforce object id.

success

boolean, if operation was successful true.

errors

array, if operation fails, it will contain description of errors.

Metadata description

Metadata for each particular Object type + Lookup by field is generated dynamically.

Upsert object action

Creates or Updates Selected Object. This action creates a single object. The input metadata is fetched dynamically from your Salesforce account. The output metadata is the same as input metadata, so you may expect all fields that you mapped as input to be returned as output.

Upsert Object action

Input field description

Object

Choose the object type you want to find from this input field. For example, Account

Type of search

A menu list with the following options:

All fields

All available fields in the object.

Unique fields

The fields where type is id or unique is true

External IDs

The fields where externalId is true, this option uses Salesforce’s upsert method.

These fields work as shown:

Type of search Lookup Value Behavior

Any

No

A new object will be created

External IDs

Yes

An object will be upserted directly on the Salesforce side. When this field has an attribute Unique it would guarantee that no errors are emitted.

Unique Fields
All Fields

Yes

An action will first lookup for an existing object in Salesforce:

  • If no objects found:: a new one will be created

  • If 1 object found:: it will be updated

  • If more than 1 object found:: ar error Found more than 1 Object will be thrown

Lookup by field

A menu list with fields on the selected object, depending on the type of search.

Expected input metadata

Lookup by

The name of the field selected in Lookup by field.

Other fields

As used by selected Object.

Expected output metadata

The result of creating or updating an object.

id

Unique identification from Salesforce.

success

A boolean result of creation/update object.

errors

Arrey of errors if they exist.

Lookup object action (at most 1)

Look up an object by a selected field. This action creates a single object. The input metadata is fetched dynamically from your Salesforce account. The output metadata is the same as input metadata, so you may expect all fields that you mapped as input to be returned as output.

Lookup Object action (at most 1)

Input field description

Object

Dropdown list displaying all searchable object types. Select one type to query, For example, Account.

Type of search

Dropdown list with two values: Unique Fields and All Fields.

Lookup by field

Dropdown list with all fields on the selected object if the Type Of Search is All Fields. If the Type Of Search is Unique Fields, the dropdown instead lists all fields on the selected object where type is id or unique is true.

Include linked objects

Multiselect dropdown list with all the related child and parent objects of the selected object type. List entries are given as Object Name/Reference To (Relationship Name). Select one or more related objects, which will be join-queried and included in the response from your Salesforce Organization.

Allow zero results

Checkbox. If this checkbox is selected and nothing is found in your Salesforce Organization, an empty object is returned. If this checkbox is cleared and nothing is found, the action will throw an error.

Pass binary data to the next component (if found object has it)

Checkbox. If this checkbox is selected and the found object record has a binary field (primitive type base64), then the data is passed to the next component as a binary attachment.

Metadata description

Metadata contains one field whose name, type and requirement are generated according to the value of the Lookup by field and Allow criteria to be omitted configuration fields.

Limitations

This action has a caching mechanism. By default, this action stores the last 10 request-response pairs for a duration of 10 min. These parameters can be changed by setting environment variables:
HASH_LIMIT_TIME

Hash expiration time in millis

HASH_LIMIT_ELEMENTS

Hash size number limit

Lookup objects action

Look up a list of objects satisfying specified criteria.

Lookup Object actions

Input field description

Object

Choose the object type you want to find from this dropdown list. For example, Account.

Include deleted

A checkbox which if selected, then deleted records will be included into the result list.

Output method

A dropdown list with following values: "Emit all", "Emit page", "Emit individually".

Number of search terms

Text field to specify a number of search terms (positive integer number [1-99] or 0).

Enable cache usage

Flag to enable cache usage.

Max fetch count

Limit for a number of messages that can be fetched. 1,000 is the default value when the variable is not set.

This action has caching mechanism. By default, this action stores last 10 request-response pairs for a duration of 10 min. These parameters can be changed by setting environment variables:
HASH_LIMIT_TIME

Hash expiration time in millis

HASH_LIMIT_ELEMENTS

Hash size number limit

Metadata description

Depending on the Output method configuration field, the input metadata can contain different fields:

Emit page
Page size

An optional positive integer that defaults to 1000;

Page number

A required non-negative integer (starts with 0, default value 0);

Emit all
Maximum number of records

An optional positive integer (default value 1000);

Emit individually
Maximum number of records

An optional positive integer (default value 10000);

The number of records this component generates may affect the performance of the platform/component.

Groups of fields for each search term:

Field name

String represents object’s field (a list of allowed values is available);

Field value

String represents value for selected field;

Condition

One of the following: =, !=, <, <=, >, >=, LIKE, IN, NOT IN;

Between each two term’s group of fields:

Logical operator

One of the following: AND, OR;

The output data is an object, with a field "results" that is an array of objects.

Bulk create/update/delete action

Bulk API provides a simple interface for quickly loading large amounts of data from a CSV file into Salesforce (up to 10,000 records).

This action takes a CSV file from the attachment as an input.

The CSV file format is described in the Salesforce documentation

Bulk Create/Update/Delete action

Input field description

Operation

Dropdown list with the supported operations: Create, Update and Delete.

Object

Choose the object type from this dropdown list to perform the bulk operation. For example, Case.

Timeout

Maximum time to wait until the server completes a bulk operation (default: 600 sec).

The result is an object with a property result: array.

Each object contains the following fields:

id

A string field. The Salesforce object ID.

success

A boolean field. If the operation was successful this is true.

errors

An array field. If the operation failed, this contains a description of the errors.

Limitations

  • No errors thrown in case of failed Object Create/Update/Delete ("success": "false").

  • Object ID is needed for Update and Delete.

  • Salesforce processes up to 10'000 records from the input CSV file.

Bulk query action

Fetches records to a CSV file.

Bulk Query action

Input field description

SOQL query

Input field where you should type the SOQL query. For example, "SELECT ID, Name from Contact where Name like 'John Smi%'"

The result is a CSV file in the attachment.

Raw request

Raw request

Input metadata

HTTP verb

A required value; GET, POST, PUT, PATCH, DELETE, HEAD. HTTP verb to use in the request.

Path

An optional string The path to which to make a request (without /services/data/vSALESFORCE_API_VERSION. For example, to list sobjects, type here sobjects instead of: https://INSTANCE_NAME.salesforce.com/services/data/vSALESFORCE_API_VERSION/sobjects.

Request body

An optional object. Body to attach to the HTTP Request.

Output metadata

Response object

An optional object. The HTTP response body.

Known limitations

For the methods PUT and HEAD you must specify the whole path. For example, services/OpportunityLineItem/00kR0000001WJJAIA4/OpportunityLineItemSchedules may have conflicts with the /services/data/vSALESFORCE_API_VERSION/RESOURCE path, so Raw Request does not work for these two methods (PUT and HEAD). This is expected to be resolved in the future.

Further resources

More information is available in the Salesforce documentation Resources list.

Examples

Examples of using REST API resources can be found in the Salesforce documentation User tasks section.