[go: up one dir, main page]

Covered in this article
Related pages
Latest Changelog
Version 2.9.0 ()
Salesforce component

Salesforce component

A component for seamless integration with the Salesforce REST API, enabling you to trigger flows based on Salesforce data and perform various actions.

Table of Contents

General Information

Description

A component for seamless integration with the Salesforce REST API, enabling you to trigger flows based on Salesforce data and perform various actions.

Please Note: The component works with the Salesforce API. This means you must make sure your Salesforce edition has API Access enabled. To check which editions have API access see the Salesforce editions with API Access document. If your edition has no API Access by default this component will not work for you..

Completeness Matrix

On the technical notes page you can find some technical details about Salesforce component like changelog and the completeness matrix.

API Version

The component uses Salesforce API Version 46.0 by default, but this can be overridden by the environment variable SALESFORCE_API_VERSION.

Please note: Deprecated Actions and Triggers - API Version 25.0.

Environment Variables

Name Mandatory Description Values
SALESFORCE_API_VERSION No Overrides the default Salesforce API version. Default: 46.0
REFRESH_TOKEN_RETRIES No The number of retries to refresh a token before throwing an error. Default: 10
HASH_LIMIT_TIME No Cache expiration time in milliseconds for Lookup actions. Default: 600000
HASH_LIMIT_ELEMENTS No The maximum number of entries in the cache for Lookup actions. Default: 10
UPSERT_TIME_OUT No Timeout for the Upsert Object action in milliseconds. Default: 120000 (2min)

Please Note: From the platform version 20.51 we deprecated the component LOG_LEVEL environment variable. Now you can control logging level per each step of the flow.

Credentials

Authentication occurs via OAuth 2.0.

To use OAuth 2.0, you must create a Connected App in your Salesforce instance. During the app creation process, you will be asked to specify a Callback URL. To process OAuth authentication on the platform, your callback URL should be in the format https://your-tenant.elastic.io/callback/oauth2.

More information can be found in the official Salesforce documentation.

Warning: To maintain a smooth experience, we recommend reusing stored credentials where possible. Duplicating secrets across OAuth clients can result in errors and complications.

For more information, please read our Creating OAuth App for Salesforce article.

During credentials creation you would need to:

1. Select an existing Auth Client from the Choose Auth Client dropdown or create a new one.

Add new client

To create a new Auth Client, specify the following fields:

Define client

Field Name Mandatory Description
Name Yes A name for your Auth Client.
Client ID Yes Your Connected App’s Consumer Key.
Client Secret Yes Your Connected App’s Consumer Secret.
Authorization Endpoint Yes Your OAuth authorization endpoint. For production, use <code>https://login.salesforce.com/services/oauth2/authorize</code>. For sandboxes, use <code>https://test.salesforce.com/services/oauth2/authorize</code>.
Token Endpoint Yes Your OAuth token endpoint for refreshing access tokens. For production, use <code>https://login.salesforce.com/services/oauth2/token</code>. For sandboxes, use <code>https://test.salesforce.com/services/oauth2/token</code>.

Here you can see how to select an existing client:

Choose client

2. Provide a name for your credential in the Name Your Credential field.

3. Click Authenticate. If you are not already logged into Salesforce, a login window will appear. Please enter your credentials.

4. Click Verify to confirm the credentials are working.

5. Click Save to save your credentials.

Please note: Salesforce migration or any changes that affect endpoints, single sign-on (SSO), OAuth and JSON web tokens (JWT), and other connections can lead to unpredictable behavior that can cause authentication issues. To avoid this after making changes you need to create new credentials and authenticate again, once this is done the old ones can be safely removed from the platform.

Triggers

Salesforce component includes the following triggers:

  1. Get Updated Objects Polling Polls for objects that have been created or updated within a given time frame.
  2. Query Trigger Executes a user-defined SOQL query during each polling interval to fetch records.
  3. Subscribe to Platform Events (Real-time Flows Only) Subscribes to a specified Platform Event using the Salesforce Streaming API.
  4. Subscribe to Pub/Sub Events Subscribes to a specified Platform Event using the Salesforce Pub/Sub API.

You can find information on deprecated triggers here.

Actions

Use this list to navigate to the action you seek.

  1. Bulk Create/Update/Delete/Upsert Uses the Bulk API 2.0 to quickly load large amounts of data (up to 10,000 records) from a CSV file into Salesforce.
  2. Bulk Query Fetches a large number of records using a SOQL query and streams the result as a CSV file in an attachment.
  3. Create Object Creates a single new object in Salesforce.
  4. Delete Object (at most 1) Deletes a single object found by a specified field and value.
  5. Lookup Object (at most 1) Looks up a single object by a specified field and value.
  6. Lookup Objects Looks up a list of objects that satisfy the specified criteria.
  7. Query Action Executes a SOQL query.
  8. Raw Request Executes a custom REST API call to a Salesforce endpoint.
  9. Upsert Object Creates a new object or updates an existing one.

You can find information on deprecated actions here.

Permissions

By default, certain user profiles in Salesforce have disabled permissions. To ensure an object is visible in the component’s dropdowns, you may need to enable its standard object permissions.

To enable these permissions:

  1. Go to the Salesforce Setup page.
  2. Navigate to Administration > Users > Profiles.
  3. Select the profile that needs modification and click Edit.
  4. Under Standard Object Permissions, ensure the necessary permissions are enabled. For example, to use the Get Updated Objects Polling trigger, the Read, Create, and Edit permissions are typically required for the object.
Salesforce setup page

Salesforce setup page

Once you are on the profile editing page, ensure that all the required standard object permissions are enabled. For instance, if you intend to utilize the Get New and Updated Objects Polling trigger, the following permissions are necessary: Read, Create, and Edit.

Standart objects permissions

Standart objects permissions

Carefully review the permissions and make any necessary adjustments to enable the required access.

Known limitations

Attachments mechanism doesn’t work with Local Agent Installation.

Click here to learn more about the elastic.io iPaaS