How to use IBM App Connect with Salesforce
Salesforce is a work management and project tracking application that helps teams to collaborate and track progress online.
New work comes from many sources. Your team might enter a new lead into the marketing system. Or a new contact might subscribe to your newsletter. App Connect makes sure that your team can concentrate on the most important work by automatically creating new assets in Salesforce, or updating other applications when you create a task in Salesforce.
The following information describes how to use IBM® App Connect to connect Salesforce to your other applications and how to use some of the Salesforce features.
Supported product and API versions
To find out which product and API versions this connector supports, see Detailed System Requirements on the IBM Support page.
Supported editions
- If you don't have a Salesforce account, you can create a
Developer
account to try Salesforce for free. Important: If you want to create a free Salesforce account to test with App Connect, make sure that you create a Developer account rather than a Trial account. If you connect to App Connect with a Trial account, the Salesforce events do not work.
- Your edition of Salesforce needs to be enabled for API
access (
API enabled
).A free trial of Salesforce isn't API enabled. Therefore, sign up to the Developer edition instead.
By default, API access is only allowed on Enterprise, Developer, Unlimited, and Performance editions. The professional edition does not come with free API access, and you might need to pay to enable the API access or upgrade to a higher edition.
Ask your Salesforce administrator if your edition of Salesforce is API enabled, and if necessary request API enablement or upgrade to a higher edition that has API access.
- To make sure that all the Salesforce events work properly,
make sure that the streaming API access is enabled for your organization.
Streaming APIs maintain a constant connection that transmits updated data to the user until the connection ends. When a user wants to take in a steady stream of rapidly changing live data, streaming APIs are ideal. The server repeatedly sends responses back with updated information until the user closes the connection.
To enable a streaming API for your organization, complete the following steps.- Log in to your Salesforce account.Note: You can choose to update these settings in lightning mode or classic mode.
- Click Setup (classic) or click the gear icon, then click Setup (lightning).
- Search for User Interface in the Quick Find box, then select User Interface.
- On the User Interface page, under the Setup section,
make sure that the Enable Streaming API checkbox is checked.
If not, click the checkbox and then click Save.
- Log in to your Salesforce account.
Connecting to Salesforce
To connect App Connect to a Salesforce account, see Connecting to Salesforce from App Connect Enterprise as a Service.
Configuring Mutual TLS (mTLS) authentication
For enhanced security when you connect to Salesforce, you can configure mutual TLS authentication. Mutual TLS provides an extra layer of security by requiring both the client and server to authenticate each other by using digital certificates.
Mutual TLS authentication is supported for the following authentication types in App Connect:
- OAuth 2.0 Password
- Basic OAuth
- Basic JWT
You can request mutual TLS for your organization by raising a request to Salesforce Support with basic information.
To use mutual TLS authentication, you must first upload your certificate to Salesforce. For detailed instructions about uploading mutual authentication certificates, see Upload a Mutual Authentication Certificate in the Salesforce documentation.
When you configure your connection in App Connect, you can provide the following mTLS credentials:
- mTLS certificate
- The client certificate in PEM format that is used to authenticate your application to Salesforce. This certificate must match the certificate that you uploaded to Salesforce.
- mTLS private key
- The private key in PEM format that corresponds to your mTLS certificate. This key is used to establish the secure connection.
For more information about mutual TLS authentication in Salesforce, see Mutual Authentication Certificate Requirements and Salesforce Platform: Enable Mutual Authentication for Enhanced Security on the Salesforce documentation page.
Considerations for connected apps in Salesforce
When connected, IBM App Connect services are listed on the Salesforce Connected Apps OAuth Usage page:
Salesforce has a limit of 5 connected apps per user for your organization. After a fifth approval is made for a connected app, the oldest approval is revoked. In instances of App Connect, avoid creating more than 5 accounts across all Salesforce applications in the App Connect page (previously the Catalog page). Other Salesforce connected applications, such as user-agent flows, can also reduce the maximum 5 accounts. For more information about this consideration, see Manage OAuth-Enabled Connected Apps Access to Your Data in the Salesforce documentation. (If such revoked access affects App Connect, when you try to use the associated Salesforce account in a flow you see a message like We can't connect to Salesforce with the account details that you provided..)
General considerations for using Salesforce in App Connect
- To avoid the
401 Unauthorized Access
error due to discovery call failure, make sure that you set the Session Security Level at login value to 'None' instead of 'High Assurance'.To set the session security level to 'None', complete the following steps:- Log in to your Salesforce account.Note: You can choose to update these settings in lightning mode or classic mode.
- Click Setup (classic), or click the gear icon, then click Setup (lightning).
- On the Administer section (classic) or Administration section (lightning), expand Manage users (classic) or Users (lightning), then click Users.
- On the All Users page, click the profile name that is associated with your account.
- On the profile page, click Edit.
- Under Session Settings, set the Session Security Level Required at Login value to None.
- Click Save.Note: You might be asked to verify your identity by using an authentication method.
- Log in to your Salesforce account.
- To connect to Salesforce sandboxes or subdomains, and use
Salesforce as a source application to trigger events, the Salesforce
Organization
object must be enabled in your Salesforce environment. Ask your Salesforce administrator to enable the object. - App Connect provides optimized event handling for Salesforce. For Salesforce events, you can use the following subset of standard objects that Salesforce PushTopic queries support: Account, Campaign, Case, Contact, Lead, Opportunity, and Task.
- When you specify dates, use the ISO standard format YYYY-MM-DD. For example, specify 19 September 2017 as 2017-09-19.
- A maximum of 15 flows can run concurrently with the same Salesforce account. If more than 15 flows try to run with the same Salesforce account, you see the error You've exceeded your organization's concurrent user limit for your Salesforce account. If you encounter a concurrent user limit error for Salesforce, wait for a few minutes then try again to trigger the event-driven flow or to call the API operation.
- (General consideration) You can see lists of the trigger events and
actions that are available on the Applications and APIs page of the App Connect Designer.
For some applications, the events and actions depend on the environment and whether the connector supports configurable events and dynamic discovery of actions. If the application supports configurable events, you see a Show more configurable events link under the events list. If the application supports dynamic discovery of actions, you see a Show more link under the actions list.
- (General consideration) If you are using multiple accounts for an application, the set of fields that is displayed when you select an action for that application can vary for different accounts. In the flow editor, some applications always provide a curated set of static fields for an action. Other applications use dynamic discovery to retrieve the set of fields that are configured on the instance that you are connected to. For example, if you have two accounts for two instances of an application, the first account might use settings that are ready for immediate use. However, the second account might be configured with extra custom fields.
Platform events
If platform events are defined in your Salesforce organization to deliver custom event notifications when
something meaningful happens, you can add those platform events to your App Connect flows. You can
add a platform event either as an event that uses an event notification (or event
message) from Salesforce, or an action that
publishes an event notification. To help you easily identify platform events in App Connect, the
label (Platform event) is appended to each platform event in the Salesforce list of events and actions.

- To add a platform event as an App Connect event that triggers a flow, use the
Configure more events link to display more Salesforce objects. Then select the platform event that you want to
add to the flow. Tip: To quickly search for a platform event in the list of events or actions that are discovered, you can type (plat in the search field, as a filter.
You can optionally map to the platform event fields in subsequent nodes in the flow to pull in data from the event notification. When the flow runs, the configured actions are processed whenever a new event notification (that is, an instance of the platform event) is published in your Salesforce organization.
Figure 2. Example of selecting a platform event as an App Connect event 
Figure 3. Example of mapping to platform event fields from an App Connect action 
- To add a platform event to a flow as an App Connect action, use the Show
More link to display more Salesforce objects, then
select the platform event for which you want to create (or publish) an event notification. In the
resulting
Create
node, you can then complete the custom fields that were configured in the Salesforce platform event definition. When the flow runs, App Connect publishes the event notification, and any Salesforceafter inserttrigger on that event runs.Figure 4. Example of selecting a platform event as an App Connect action 
Figure 5. Example of custom fields in the platform event definition 
Figure 6. Example of custom fields in the corresponding App Connect action (continued) 
Updating required fields
- If you're creating a lead, you must provide values for the Last Name and Company fields.
- If you are creating an account, you must provide a value for the Account Name field.
Create orderaction, in addition to the required fields (marked with an asterisk *), you must also complete the Contract ID or Account ID field. If this ID is missing, an error is generated to highlight such dependencies when you run the flow.

Specifying unique IDs
Create orderaction, a Contract ID or Account ID value is needed. You can either enter a hardcoded value or map to a value from a previous node in the flow.


Change Data Capture
The Change Data Capture feature in Salesforce notifies you
when any changes occur in the objects that you are interested in. Specific information about state
changes is captured and provided in a notification. If you enabled Change Data Capture
on
objects in Salesforce, you can access those objects in App Connect so that you can capture all the times an object was
modified. For instance, you might use a Salesforce
Update lead node as an event trigger in one of your flows to be notified
whenever a lead is updated. If you enabled Change Data Capture
on the Leads object in Salesforce, you can now be notified whenever a change is made to a
lead with information that wasn’t available before. This information might include who modified the
object, when the object was modified, and what fields were changed.
Flows that use Salesforce objects with Change Data
Capture
keep you informed about incremental updates that occur in your App Connect integrations.
To use Change Data Capture
objects in App Connect, you must first set up the required
permissions in Salesforce. To update permissions in Salesforce, go to
. In the Standard Object Permissions
section, find the object that you want to update. Make sure that Basic Data
Administration is set to View All. By default,
Read is also selected.
We can't retrieve the Change Data Capture events for the Salesforce Contact object because
your Salesforce account doesn't have the required permission on the object to subscribe to subscribe
to Change Data Capture.
Ensure that your Salesforce account has the required permission to subscribe to Change Data Capture.Change Data Captureisn't supported for this user role.
All custom objects and a subset of standard objects are supported for use of Change Data
Capture
in Salesforce. For the full list, see Change Event Object Support in the Salesforce documentation.
Select the objects for which you want to receive change notifications. In Salesforce, go to Setup, type Change Data Capture in the Quick Find box, then select Change Data Capture. Select the entities that you want to receive change notifications for, then click Save. For more information, see Select Objects for Change Notifications in the Salesforce documentation.
We can't retrieve the Change Data Capture events for the Salesforce Contact object because
the object isn't configured for Change Data Capture.
Ensure that you selected a valid Salesforce object and the object is configured for Change Data Capture.After you enable Change Data Capture
in Salesforce,
you can add a Change Data Capture
object to your App Connect
flows as an event that uses an event notification from Salesforce. To help you easily identify Change Data Capture
events in App Connect, the label (Change Data Capture) is
appended to each Change Data Capture
event in the Salesforce list of events.

Change Data Captureobject as an App Connect event that triggers a flow, use the Configure more events link to display more Salesforce objects. Then select the
Change Data Captureevent that you want to add to the flow.
Change Data Captureevent in the list of events that are discovered, type Change Data Capture in the search field as a filter.

Change Data Captureobjects.
{
"schema": "<schema_ID>",
"ChangeEventHeader": {
"entityName" : "...",
"recordIds" : "...",
"changeType" : "...",
"changedFields": [...],
"changeOrigin" : "...",
"transactionKey" : "...",
"sequenceNumber" : "...",
"commitTimestamp" : "...",
"commitUser" : "...",
"commitNumber" : "..."
},
"field1":"...",
"field2":"...",
. . .
"event": {
"replayId": <replayID>
}
},
You can optionally map to any of these Change Data Capture
event fields in subsequent
nodes in the flow to pull in data from the change notification. The mapping also includes any fields
that belong to the object (such as middle name or postcode), as demonstrated by
field1 and field2 in the code example. Standard fields, for
example, created date and last modified date are always included. When the flow runs, the configured
actions are processed whenever a new change notification (that is, an instance of the Change Data
Capture
event) is published in your Salesforce
organization.

Change Data Captureevents. If you exceed this limit, you must stop some flows that are using
Change Data Captureevent nodes.
Post connection considerations
- When you select an event for Salesforce, the
Event configuration page appears.

- Replay ID field: Specify the replay ID. If no value is specified, it
defaults to
-1. If you specify-2as the replay ID when a large number of event messages are stored, you might experience performance issues. For more information on Salesforce Message Durability, see Message Durability. - Subscription Type field: Select Pub/Sub or gRPC or
CometD based on your requirement. For more information, see Subscribing to Platform Events and Pub/Sub API as a gRPC API.
CometD subscriptions: Use
-1to receive only new events,-2(or0/1) to receive all available events, or specify a specific replay ID number (for example,12345) to start from that point.gRPC subscriptions: Set
-1maps to LATEST (0),-2maps to EARLIEST (1), and specific replay IDs map to CUSTOM (2), with the replay ID converted to a byte array.
- Replay ID field: Specify the replay ID. If no value is specified, it
defaults to
- You can use the Run custom SOQL query action to fetch the data from an
organization database for the respective objects that are specified in the query. For more
information about SOQL, see Introduction to SOQL and SOSL in the Salesforce documentation.The following examples illustrate some scenarios and their SOQL queries.
Scenario SOQL queries To get the records for the selected fields from the Leads object with the title CFOor CityTallahasseeSELECT Id, Name, title FROM Lead WHERE Title='CFO' OR City='Tallahassee'To get the records for the selected fields from the Leads object SELECT Id, Name, title FROM Lead OFFSET 0To get the 20 records for the selected fields (but not the first 5 records, that is, from the 6th through 20th records) from the Leads object SELECT Id, Name, title FROM Lead LIMIT 15 OFFSET 5To get records for selected fields from the Opportunities object with the Amount field value greater than or equal to 100000 SELECT Id, Name, Amount FROM Opportunity WHERE Amount >= 100000To get records for selected fields from the Opportunities object with the Name field in ascending order SELECT Name, Amount, Type FROM Opportunity ORDER BY Name ASCTo get the records for selected fields from the Accounts and Contacts objects SELECT Name, Phone, Industry, (SELECT Name FROM Contacts) FROM AccountTo get the sum of amount from Opportunities object for a calendar year SELECT CALENDAR_YEAR(CreatedDate) CreatedDate, SUM(Amount) Amount FROM Opportunity GROUP BY CALENDAR_YEAR(CreatedDate)To get selected fields from the Accounts object for specified industry values only SELECT Name, Type, Phone, Industry FROM Account WHERE Industry IN ('Energy','Consulting','Hospitality')To get selected fields from the Contacts object for the names that start with the letter A and the Rating as Hotregarding the Accounts object (Child to Parent relationship query)SELECT Id, Name, Phone, Email, Account.Name, Account.Rating, Account.Industry FROM Contact WHERE Account.Rating='Hot' AND Name LIKE 'A%'
Replay ID
- Replay ID
- Enter the replay ID to receive all the retained events after the ID of the event notification specified in this field. This option is useful to catch up with missed events after a connection failure or whenever you need to stop a flow (for instance to reauthenticate your connection).
- -1
- Enter -1 to receive new event notifications after the flow is triggered.
- -2
- Enter -2 to receive all events, including past events that are within the retention window and new events after the flow is triggered.

s
Events and actions
Salesforce events
These events are for changes in this application that trigger a flow to start completing the actions in the flow.
| Object | Event | Description |
|---|---|---|
| Accounts | New account | Triggers when a new account is created in Salesforce |
| Updated account | Triggers when an account is updated in Salesforce | |
| Campaigns | New campaign | Triggers when a campaign is created in Salesforce |
| Updated campaign | Triggers when a campaign is updated in Salesforce | |
| Cases | New case | Triggers when a case is created in Salesforce |
| Updated case | Triggers when a case is updated in Salesforce | |
| Contacts | New contact | Triggers when a contact is created in Salesforce |
| Updated contact | Triggers when a contact is updated in Salesforce | |
| Leads | New lead | Triggers when a lead is created in Salesforce |
| Updated lead | Triggers when a lead is updated in Salesforce | |
| Opportunities | New opportunity | Triggers when an opportunity is created in Salesforce |
| Updated opportunity | Triggers when an opportunity is updated in Salesforce | |
| Tasks | New task | Triggers when a new task is created in Salesforce |
| Updated task | Triggers when a task is updated in Salesforce |
Events that are shown by default are preconfigured by using optimized connectivity. To see more events, click Show configurable events to poll Salesforce for new or updated objects. For more information about configurable events, see Configuring polled events to trigger flows.
Salesforce actions
Your flow completes these actions on this application.
| Object | Action | Description |
|---|---|---|
| Accounts | Create account | Creates an account in Salesforce |
| Create bulk accounts | Creates multiple accounts in Salesforce | |
| Create bulk accounts | Creates multiple accounts in Salesforce | |
| Delete account | Deletes a Salesforce account | |
| Delete bulk accounts | Deletes multiple accounts in Salesforce | |
| Retrieve accounts | Retrieves the Salesforce accounts | |
| Update account | Updates a Salesforce account | |
| Update bulk accounts | Updates multiple accounts in Salesforce | |
| Update or create account | Updates an account if account exists, else creates an account | |
| Attachments | Retrieve contents of attachment | Retrieves the contents of the attachment |
| Campaigns | Create bulk campaigns | Creates multiple campaigns in Salesforce |
| Create campaign | Creates a campaign in Salesforce | |
| Delete bulk campaigns | Deletes multiple campaigns in Salesforce | |
| Delete campaign | Deletes a campaign from Salesforce | |
| Retrieve campaigns | Retrieves campaigns from Salesforce | |
| Update bulk campaigns | Updates multiple campaigns in Salesforce | |
| Update campaign | Updates a campaign in Salesforce | |
| Update or create campaign | Updates a campaign if campaign exists, else creates a campaign | |
| Cases | Create bulk cases | Creates multiple cases in Salesforce |
| Create case | Creates a case in Salesforce | |
| Delete bulk cases | Deletes multiple cases in Salesforce | |
| Delete case | Deletes a case from Salesforce | |
| Retrieve cases | Retrieves the cases from Salesforce | |
| Update bulk cases | Updates multiple cases in Salesforce | |
| Update case | Updates a case in Salesforce | |
| Update or create case | Updates a case if case exists, else creates a case | |
| Contacts | Create bulk contacts | Creates multiple contacts in Salesforce |
| Create contact | Creates a contact in Salesforce | |
| Delete bulk contacts | Deletes multiple contacts in Salesforce | |
| Delete contact | Deletes a contact from Salesforce | |
| Retrieve contacts | Retrieves the contacts from Salesforce | |
| Update bulk contacts | Updates multiple contacts in Salesforce | |
| Update contact | Updates a contact in Salesforce | |
| Update or create contact | Updates a contact if contact exists, else creates a contact | |
| Content documents | Retrieve contents of content document | Retrieves the contents of the content document |
| Custom SOQL queries | Run custom SOQL query | Runs a custom Salesforce Object Query Language (SOQL) query to search your
organization’s Salesforce data for specific information Restriction: The maximum allowed
limit for a single batch is 2000 records. You get a catalog error if the limit exceeds
2000.
|
| Custom SOSL queries | Run custom SOSL query | Runs a custom Salesforce Object Search Language (SOSL) query to construct text-based search queries against the search index |
| Emails | Send mass email | Service for sending mass emails |
| Send single email | Service for sending single email with attachments | |
| Events | Create bulk events | Creates multiple events in Salesforce |
| Create event | Creates an event in Salesforce | |
| Delete bulk events | Deletes multiple events in Salesforce | |
| Delete event | Deletes an event from Salesforce | |
| Retrieve events | Retrieves the events from Salesforce | |
| Update bulk events | Updates multiple events in Salesforce | |
| Update or create event | Updates an event if event exists, else creates an event | |
| File shares | Retrieve file shares | Retrieves the file shares from Salesforce |
| Share file | Shares the file in Salesforce | |
| Files | Create file | Creates a file in Salesforce |
| Delete file | Deletes a file from Salesforce | |
| Delete files | Deletes files in bulk from Salesforce | |
| Download file content | Downloads the content of the file | |
| Retrieve files metadata | Retrieves the metadata of a file from Salesforce | |
| Update file metadata | Updates the metadata of a file in Salesforce | |
| Upload new file version | Uploads a new file version in Salesforce | |
| Folders | Create bulk folders | Creates multiple folders in Salesforce |
| Create folder | Creates a folder in Salesforce | |
| Delete bulk folders | Deletes multiple folders in Salesforce | |
| Delete folder | Deletes a folder from Salesforce | |
| Retrieve folders | Retrieves the folders from Salesforce | |
| Update bulk folders | Updates multiple folders in Salesforce | |
| Update folder | Updates a folder in Salesforce | |
| Update or create folder | Updates a folder if folder exists, else creates a folder | |
| Leads | Convert lead | Converts a lead into an account, contact, or opportunity |
| Create bulk leads | Creates multiple leads in Salesforce | |
| Create lead | Creates a lead in Salesforce | |
| Delete bulk leads | Deletes multiple leads in Salesforce | |
| Delete lead | Deletes a lead from Salesforce | |
| Retrieve leads | Retrieves the leads from Salesforce | |
| Update bulk leads | Updates multiple leads in Salesforce | |
| Update lead | Updates a lead in Salesforce | |
| Update or create lead | Updates a lead if lead exists, else creates a lead | |
| Merge | Merge objects | Combines records of the same object type into one record known as the main record |
| Opportunities | Create bulk opportunities | Creates multiple opportunities in Salesforce |
| Create opportunity | Creates an opportunity in Salesforce | |
| Delete bulk opportunities | Deletes multiple opportunities in Salesforce | |
| Delete opportunity | Deletes an opportunity from Salesforce | |
| Retrieve opportunities | Retrieves the opportunities from Salesforce | |
| Update bulk opportunities | Updates multiple opportunities in Salesforce | |
| Update opportunity | Updates an opportunity in Salesforce | |
| Update or create opportunity | Updates an opportunity if opportunity exists, else creates an opportunity | |
| Orders | Create bulk orders | Creates multiple orders in Salesforce |
| Create order | Creates an order in Salesforce | |
| Delete bulk orders | Deletes multiple orders in Salesforce | |
| Delete order | Deletes an order from Salesforce | |
| Retrieve orders | Retrieves orders from Salesforce | |
| Update bulk orders | Updates multiple orders in Salesforce | |
| Update order | Updates an order in Salesforce | |
| Update or create order | Updates an order if order exists, else creates an order | |
| Products | Create product | Creates a product in Salesforce |
| Retrieve products | Retrieves the products from Salesforce | |
| Records | Undelete records | Undeletes records that are deleted and restores them to their last known state |
| Server timestamps | Retrieve server timestamp | Retrieves the current system timestamp in Coordinated Universal Time (UTC) format |
| Solutions | Create solution | Creates a solution in Salesforce |
| Retrieve solutions | Retrieves the solutions from Salesforce | |
| Tasks | Create bulk tasks | Creates multiple tasks in Salesforce |
| Create task | Creates a task in Salesforce | |
| Delete bulk tasks | Deletes multiple tasks in Salesforce | |
| Delete task | Deletes a Salesforce task | |
| Retrieve tasks | Retrieves the Salesforce tasks | |
| Update bulk tasks | Updates multiple tasks in Salesforce | |
| Update or create task | Updates a task if task exists, else creates a task | |
| Update task | Updates a Salesforce task | |
| User information | Reset user password | Initiates a password reset for a user based on the user ID by sending a reset email and returning a temporary password for login if the email link can't be used |
| Retrieve user information | Retrieves the personal information of the user associated with the current session | |
| Set user password | Sets the password provided in the request body as the user's new password, ensuring it complies with the organization's password policies |
More items are available after you connect App Connect to Salesforce.
Examples
Use templates to quickly create flows for Salesforce
Learn how to use App Connect templates to quickly create flows that complete actions on Salesforce. For example, go to the Discover page and search for Salesforce.

Use IBM App Connect to build flows that integrate with Salesforce.
The following blog post describes how to retrieve records for campaigns and their members from Salesforce and update the rows of the Microsoft Excel Online worksheet with campaign details. Click Read the blog to go to the blog.