How to use IBM App Connect with Salesforce
Salesforce is a work management and project tracking app that provides projects, tasks, conversations, and dashboards to enable teams to collaborate and track progress online.
New work comes from many sources, whether it's a new lead entered by one of the teams into the marketing system or a new contact subscribing to your newsletter. App Connect ensures that your team is always on the ball and handling the most important work by automatically creating new projects and tasks in Salesforce, or updating other apps 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 an 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
).If you're using a free trial of Salesforce, it won't be API enabled; sign up to the Developer edition instead.
By default, API access is only allowed on Enterprise, Developer, Unlimited, and Performance editions. 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 connection is finally closed by the user.
To enable 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.
Considerations for connected apps in Salesforce
When connected, IBM App Connect services, like IBM App Connect Prod UK
, 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 an App Connect service,
avoid creating more than 5 accounts across all Salesforce applications in the App Connect page (previously the Catalog page). The maximum 5 accounts might also be reduced by
other Salesforce connected apps, such as user-agent flows. For more information about this
consideration, see the Salesforce docs Manage OAuth-Enabled Connected Apps Access to Your
Data
at https://help.salesforce.com/articleView?id=remoteaccess_request_manage.htm. (If such revoked
access affects IBM App Connect, when you try to use the
associated Salesforce account in a flow you'll 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 on the profile name 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.
- If you want 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. You can ask your Salesforce administrator whether the “Organization” object is enabled in your Salesforce edition, and if necessary request that the object be enabled.
- App Connect performs optimized event handling for Salesforce. For Salesforce events, you can use the following subset of standard objects that are supported by Salesforce PushTopic queries: Account, Campaign, Case, Contact, Lead, Opportunity, and Task.
- When specifying 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 using the same Salesforce account. If more than 15
flows try to run using the same Salesforce account, you'll 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, there are several things you can do to recover; for example, wait 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 org to deliver
custom event notifications when something meaningful happens, you can add those platform events to
your App Connect flows either as an event that consumes 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, we've appended the label (Platform
event) 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, you'll need to use the
Configure more events link to display additional Salesforce objects, and then
locate and 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, in order to pull in data from the event notification. When the flow runs, the configured actions will be processed whenever a new event notification (that is, an instance of the platform event) is published in your Salesforce org.
Figure 2. Example: Selecting a platform event as an App Connect event 
Figure 3. Example: Mapping to platform event fields from an App Connect action 
- To add a platform event to a flow as an App Connect action, you'll need to use the
Show More link to display additional Salesforce objects, and then locate and
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 will publish the event notification, and any Salesforceafter inserttrigger on that event will fire.Figure 4. Example: Selecting a platform event as an App Connect action 
Figure 5. Example: Custom fields in the platform event definition 
Figure 6. Example (continued): Custom fields in the corresponding App Connect action 
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 when you need to catch up with missed events after a connection failure or for any reason that requires you to stop a flow, for instance, to re-authenticate your connection.
- -1
- Enter -1 to receive new event notifications after the flow is triggered.

Updating required fields
- If you are 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 *), you'll need to also complete the Contract ID or Account ID field. If 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 via a notification. If you have 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 has been modified. For instance, you might have used a Salesforce Update lead node as an event trigger in one of your flows to be notified whenever a lead is updated. If you have 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, such as who modified the object, when the object was modified, and what fields have been changed.
Flows by using Salesforce objects with Change Data Capture will keep you informed about incremental updates occurring in your App Connect integrations.
Permissions
You must have the required permissions set up in Salesforce to use Change Data Capture objects in App Connect.
To update permissions in Salesforce, go to . Scroll to the Standard Object Permissions section and find the object you want to update. Ensure that Basic Data Administration is set to View All. By default, Read is also selected. The following screen shot shows the permissions on a Leads object being updated for a support user profile.

If you do not have the correct permissions set up, you will see the following message in the error log.

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.
You need to select the objects for which you want to receive change notifications. To do this, 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.
If the object has been removed from entities, you will see the following message in the error log.

When you have enabled Change Data Capture in Salesforce, you can add those Change Data Capture objects to your App Connect flows as an event that consumes an event notification from Salesforce. To help you easily identify Change Data Capture events
in App Connect, we've appended the label (Change
Data Capture) to each Change Data Capture event in the Salesforce list of events.


{
"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 will also
include any fields that belong to the object, for instance middle name, postcode etc, 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 will be processed whenever a new change notification (that is, an instance of
the Change Data Capture event) is published in your Salesforce
org.

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.
- Accounts
-
- New account
- Updated account
- Campaigns
-
- New campaign
- Updated campaign
- Cases
-
- New case
- Updated case
- Contacts
-
- New contact
- Updated contact
- Leads
-
- New lead
- Updated lead
- Opportunities
-
- New opportunity
- Updated opportunity
- Tasks
-
- New task
- Updated task
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.
- Accounts
-
- Create account
- Retrieve accounts
- Delete account
- Update account
- Update or create account
- Create bulk accounts
- Create bulk accounts
- Delete bulk accounts
- Update bulk accounts
- Attachments
-
- Retrieve contents of attachment
- Campaigns
-
- Create campaign
- Retrieve campaigns
- Delete campaign
- Update campaign
- Update or create campaign
- Create bulk campaigns
- Delete bulk campaigns
- Update bulk campaigns
- Cases
-
- Create case
- Retrieve cases
- Delete case
- Update case
- Update or create case
- Create bulk cases
- Delete bulk cases
- Update bulk cases
- Contacts
-
- Create contact
- Retrieve contacts
- Delete contact
- Update contact
- Update or create contact
- Create bulk contacts
- Delete bulk contacts
- Update bulk contacts
- Content documents
-
- Retrieve contents of content document
- Custom SOQL queries
-
- Run custom SOQL query
-
Restriction: The maximum allowed limit for a single batch is 2000 records. You get a catalog error if the limit exceeds 2000.Tip: The Run custom SOQL query action allows you to fetch the data from an organization database for the respective objects specified in the query. For more information about SOQL, see Introduction to SOQL and SOSL on the Salesforce documentation page.The following are examples of 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 the 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 the 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 the 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 the selected fields from the Contacts object for the names that start with the letter A and the Rating as Hotwith reference to 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%'
- Custom SOSL queries
-
- Run custom SOSL query
- Emails
-
- Send mass email
- Send single email
- Events
-
- Create event
- Retrieve events
- Delete event
- Update or create event
- Create bulk events
- Delete bulk events
- Update bulk events
- File shares
-
- Retrieve file shares
- Share file
- Files
-
- Create file
- Retrieve files metadata
- Update file metadata
- Delete file
- Download file content
- Delete files
- Upload new file version
- Folders
-
- Create folder
- Retrieve folders
- Delete folder
- Update folder
- Update or create folder
- Create bulk folders
- Delete bulk folders
- Update bulk folders
- Leads
-
- Create lead
- Retrieve leads
- Delete lead
- Update lead
- Update or create lead
- Convert lead
- Create bulk leads
- Delete bulk leads
- Update bulk leads
- Merge
-
- Merge objects
- Opportunities
-
- Create opportunity
- Retrieve opportunities
- Delete opportunity
- Update opportunity
- Update or create opportunity
- Create bulk opportunities
- Delete bulk opportunities
- Update bulk opportunities
- Orders
-
- Create order
- Retrieve orders
- Delete order
- Update order
- Update or create order
- Create bulk orders
- Delete bulk orders
- Update bulk orders
- Products
-
- Create product
- Retrieve products
- Records
-
- Undelete records
- Server timestamps
-
- Retrieve server timestamp
- Solutions
-
- Create solution
- Retrieve solutions
- Tasks
-
- Create task
- Retrieve tasks
- Update task
- Update or create task
- Delete task
- Create bulk tasks
- Delete bulk tasks
- Update bulk tasks
- User information
-
- Reset user password
- Retrieve user information
- Set user password
More items are available when you have connected 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 perform actions on Salesforce. For example, open the Templates gallery, and then search for Salesforce.

Use IBM App Connect to build flows that integrate with Salesforce.
Read the blog in the IBM Community to learn 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.