Start using IBM® App Connect on IBM Cloud without charge: create an event-driven flow from a template, to send a Slack notification to the sales team when a new opportunity is added in Salesforce; all in a few steps, in minutes.

Duration: When preparing this article, it took less than 3 minutes from start to finish – to create, start, and test the event-driven flow.


First, find or create everything you need

Duration: 3-10 minutes, depending on whether you have some accounts already.

Get accounts for App Connect, Salesforce, and Slack…

  • Obtain an App Connect on IBM Cloud service. You can use an App Connect service that you already have or can sign up for App Connect from the IBM Cloud catalog.

    In this example, we use a new free App Connect – Lite plan service.

  • (If you haven’t already connected App Connect to your Salesforce account) The name and password of your Salesforce account.

    If you want to create a free test account in Salesforce rather than use your business account, make sure that you register for a Developer account from this URL: https://developer.salesforce.com rather than a Trial account. If you connect to App Connect with a Trial account, the Salesforce events don’t work.

  • (If you haven’t already connected App Connect to your Slack account), your team’s Slack URL (like myteam.slack.com), and the email address and password to sign in to the Slack account.
    Note: If your team isn’t using Slack yet, you can get started with Slack (without charge) and create a Slack workspace at https://slack.com/intl/en-gb/get-started#/.

In the following steps, we started without App Connect already being connected to the Salesforce and Slack accounts. We also chose to connect to Salesforce and Slack in the App Connect catalog, before we started editing the event-driven flow. (If App Connect was already connected to Salesforce and Slack accounts, such as from an earlier flow or API, we would not have needed to connect again.)

To continue, launch IBM App Connect. We’ll start from the Dashboard view of IBM App Connect, which normally displays tiles for the flows and APIs that you have created. (If you see the Welcome page, click the X to close that page and show the dashboard.)

(Click image to view full size)

Connect App Connect to the applications

Duration: A few minutes

The Catalog page enables you to connect and manage your application accounts separate from editing the flows that use those accounts. You might find it more convenient to add account details on the Catalog page, and then when editing flows simply select accounts that you want to use.

Connect applications on the Catalog page…

  1. Click Catalog; by default this shows the Applications list in alphabetical order. This is the list applications for which App Connect provides pre-built smart connectors for you to most-easily connect to the applications.
  2. Connect to your Salesforce account:
    1. Scroll down to Salesforce, and then click the expand icon.

      This displays the Connect button, to connect to the Salesforce account.

    2. Click Connect

      This displays the initial page of the Connect to Salesforce dialog.

      If required, you can use the Custom URL field to specify a special Salesforce environment (production or sandbox), or subdomain (with a personalized login page) that you want to connect to.

      If you want to learn more about using the Custom URL field for different ways to connect to Salesforce accounts, see How to use IBM App Connect with Salesforce.

      In this example, we left the Custom URL field blank, to connect to the standard (production) environment for our Salesforce Developer account. When connected, App Connect is automatically directed to use the generic production URL: https://login.salesforce.com.

    3. Click Connect
    4. To confirm that you have an appropriate Salesforce account, click Continue.

      This opens a Salesforce window for you to connect App Connect. Choose a username, and follow the Salesforce instructions to allow App Connect to access your Salesforce account.

      Salesforce window to allow App Connect access (Click image to view full size)

      In the App Connect Catalog, a message is displayed to indicate the Salesforce account has been connected, and the Salesforce account is added to the drop-down list of accounts that you can select from.

      (Click image to view full size)

  3. Connect to your Slack account:
    1. Scroll down to Slack, and then click the expand icon.

      This displays the Connect button, to connect to the Slack account and workspace.

    2. Click Connect

      If you are already signed in to a Slack workspace, you can select that for App Connect to use.

      If you are not already signed in to the Slack workspace that you want to use, continue to sign in to Slack:

    3. On the page “Sign in to your workspace”, enter your workspace’s Slack URL, then click Continue.
    4. Review the permission that App Connect needs to access your Slack workspace, then click Allow.

      (Click image to view full size)

    5. In the App Connect Catalog, a message is displayed to indicate the Slack account has been connected, and the Slack account is added to the drop-down list of accounts that you can select from. At this point, you could rename the account in App Connect.

      (Click image to view full size)

You have connected both Salesforce and Slack to App Connect, and can use those accounts in integration flows.

Create an event-driven flow from a template

Duration: A few minutes

A quick and easy way to create an event-driven flow (or an API flow) is to use a pre-built template from the App Connect gallery of templates. If needed, you can then adapt the template to your needs.

Alternatively, if you don’t see a suitable template, you can import a flow definition file or create a new flow from scratch, perhaps following one of the App Connect tutorials for specific use cases.

Create the flow from the template…

This example uses the template “Send me a Slack notification for every new Salesforce opportunity”. This template creates and sends a Slack notification to the sales team when a new opportunity is added in Salesforce.

To create the event-driven flow from the template, complete the following steps:

  1. Click the Templates menu bar option.
  2. In the search box, type send me a slack, and then click the tile labelled “Send me a Slack notification for every new Salesforce opportunity”.

    This displays a summary of the template, with brief instructions for how to use the template.

    (Click image to view full size)

  3. Click Create flow.

    This creates an event-driven flow from the template, and opens the flow in the flow editor.

    (Click image to view full size)

The flow is open in the flow editor, ready for us to validate and connect to the applications it uses.

Explore and complete the event-driven flow

Duration: A few minutes

When you create a flow from a template, it is good practice to examine the flow to understand its actions. Also, you may need to connect applications used by the flow, or may choose to change an account used or otherwise adapt the flow to your needs.

Note that with a quick glance you can see any nodes that need attention, as they are marked with an exclamation mark in a red circle. For example, if the node shows “Not connected“, this indicates that we need to connect to the application used.

Explore and complete the flow…

  1. (Optional) Change the flow name to something that is unique and meaningful to you.

    A flow created from a template is assigned the name of the template title; in this example, “Send me a Slack notification for every new Salesforce opportunity”. If you want to change the flow name, click the name field and overtype with the name you want to use; for example: Send Sales team a Slack message for a new Salesforce opportunity.

  2. Examine the event, Salesforce / New opportunity, that will be used to trigger the flow.

    The event node just shows the account to be used. If you want to change the account name shown, you must do so (on the Catalog / Applications page) before the connection is used by any running flow.

  3. Examine the action, Slack / Create message, that will be used to send a message to a channel or user in your Slack workspace.

    (Click image to view full size)

    1. Click the action node.
    2. The drop-down list “Where do you want to post the message?:” is used to select the Slack channel or user to which messages are sent. The template was configured with a channel unique to that Slack workspace, so an error message is shown that the channel ID does not exist in your Slack workspace.

      Click the “Where do you want to post the message?:” field and then select a channel in your Slack workspace.

    3. The Text field contains the message to be sent to Slack. It contains some text and maps the Opportunity ID from Salesforce. If you want to change the message, you can click the field and then delete/type text and click the ‘Insert a reference’ icon Icon to map a field from earlier node in a flow to map fields from the Salesforce / New opportunity.

      (You can also see the ‘Insert a function’ icon Icon to insert a function into a target field to insert JSONata functions into the target field.)

      (Click image to view full size)

You have examined the flow created from the template, connected App Connect to the applications used, and made some changes to complete and adapt the flow. Now let’s start the flow and examine it further.

Test the event-driven flow

Duration: A few minutes

Although we can start the flow from the flow editor, let’s return to the App Connect dashboard where we can explore more options for running and managing the flow.

Click the Dashboard link in the top left of the flow editor. This displays the App Connect dashboard, with a tile for the flow that we have just completed:

(Click image to view full size)

Test the flow…

  1. Explore the flow tile

    The flow tile on the App Connect dashboard is the quickest way to find information about a running integration.
    When the flow runs, the tile shows an icon with status information such as whether or not the flow ran successfully, any error messages, and the number of records processed; for example:

    • If the flow tile has a green tick, the flow has run successfully; click the tick to see when the flow was last triggered.

      Successful flow icon on a dashboard tile (Click image to view full size)

    • If the tile has a red exclamation point, there’s a problem; click the exclamation point to find out what’s gone wrong.

      Flow error icon on dashboard tile (Click image to view full size)

    You can use the flow tile’s options menu (⋮) to select actions to start, stop, and otherwise manage the flow.

  2. Start the flow

    Open the options menu (⋮) and then click Start. The flow tile changes to show “Running”, and the flow is waiting for a new Salesforce opportunity to be created.

  3. Sign in to the Slack account that you want App Connect to send a message to for the new Salesforce opportunity.
  4. Create a new Salesforce opportunity:
    1. Log in to Salesforce using the account that you configured in App Connect.
    2. Create a new opportunity, specifying values for the required fields and any other fields that you want to pass to Slack; for example:

      (Click image to view full size)

      Click Save.

  5. After a brief moment, a Slack notification is issued for the message; for example:

    (Click image to view full size)

    You can also check the channel in Slack; for example:

    (Click image to view full size)

    You can see the values for the ID and name mapped from the Salesforce opportunity.

  6. Return to the App Connect dashboard, and examine the flow’s tile. Hover the mouse cursor over the green tick to see the message about when the flow last ran successfully; for example:

    Flow tile showing last successful run (Click image to view full size)

  7. (Optional) Check the App Connect log for messages added for the flow run.
    1. From the App Connect hamburger menu, expand Manage then click Logs.

      App Connect menu, Manage / Logs (Click image to view full size)

      This opens the Log window for your App Connect.

      For this flow, there is only a message that the flow completed successfully. For more log information, you could add log nodes to the flow or turn enable debug logging (from the flow’s tile on the Dasboard).

      (Click image to view full size)

You have successfully configured, deployed, and tested your first event-driven flow in App Connect on IBM Cloud.

Join The Discussion

Your email address will not be published. Required fields are marked *