Creating an event-driven flow to retrieve SAP data to enhance actions on SaaS apps

Learn how easy it is to create an event-driven flow in App Connect Designer to retrieve OData resources from SAP and use the SAP data to enhance actions on SaaS apps.

Before you begin

First, find or create everything you need:

Note: If you already have an App Connect service, and have connected App Connect to Salesforce, SAP, and Asana, you can skip this step.
  • 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.

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

  • The email address and password of your Eventbrite 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 do not work.
  • Prepare SAP OData connectivity for use with App Connect Designer, as described in How to use IBM App Connect with SAP (via OData).
  • The email address and password of your Asana account.

About this task

This topic gives an example of creating an API flow in App Connect Designer to create OData resources in SAP and perform actions on SaaS apps, based on the following scenario.

Scenario:

A company is using Eventbrite for their event management tasks. When a new order is created in Eventbrite, they want App Connect Designer to automatically retrieve related booking data from SAP in their private network, create a new order in Salesforce.com, and create a task in Asana for their team to handle the new order.

Figure 1. When an Eventbrite order is created, App Connect retrieves data from SAP to create a Salesforce order and Asana task.
When an Eventbrite order is created, App Connect retrieves data from SAP to create a Salesforce order and Asana task.

(Click image to view full size.)

Rob, an integration developer, configures an event-driven flow in App Connect Designer to implement the scenario. Rob doesn't need any experience with SAP, only getting required SAP OData configuration details from his SAP admin. Rob exploits App Connect's 'configuration without coding' approach to create and then start the event-driven flow in a matter of minutes, thereafter processing each new order created in Eventbrite.

Time required: If you have already connected SAP, Salesforce, and Asana to App Connect, the steps to create and test the integration flow in this tutorial should take only a few minutes.

Procedure

  1. Log in to App Connect Designer.
  2. On the Dashboard, click New > Flow.
  3. Complete the following steps.
    As you progress, App Connect automatically saves your changes. If you navigate away from the flow at any stage, the flow is saved as a draft flow that you can complete at another time.
    1. Enter a name that identifies the purpose of your flow.
      For example: Add Eventbrite order to Salesforce
    2. Select Eventbrite > New order as the event that is to trigger the flow.
      If you haven't already connected an Eventbrite account, click Connect and follow the instructions to allow App Connect to connect to your Eventbrite account.
      Figure 2. Eventbrite / New order as event to trigger the flow.
      Eventbrite / New order as event to trigger the flow.

      (Click image to view full size.)

    3. Click the (+) and then select the SAP retrieve action that you want to use to get related booking data from SAP
      Tip:
      • This tutorial shows the use of a SAP retrieve action, but could have used a SAP create action just as easily. For an example of using a SAP create action, see the tutorial Creating an API flow to create SAP OData resources.
      • If you haven't already connected to SAP, and started the IBM® Secure Gateway client for use with SAP, you won't see any SAP actions. Click Connect and follow the instructions to allow App Connect to connect to your SAP system.
      • Before using the SAP connection in App Connect Designer, start the IBM Secure Gateway client that you configured for use with SAP. After starting the client, the App Connect Catalog page should list the SAP objects and their actions that you can use. If you start the IBM Secure Gateway client after logging in to App Connect Designer, you can refresh the App Connect Catalog page to see the list of SAP objects and their actions.
    4. Configure the conditions to be used by the SAP retrieve action to get the one record for the booking data.
      For each condition needed, select a SAP property and then configure the condition value that the property must equal for the condition to be true; for example, if you want to retrieve the record with the SAP property Passenger Name equal to the Eventbrite source field Attendee name:
      1. Select the SAP property Passenger Name
      2. In the condition value field, type or select the Eventbrite source field Attendee name.
      Figure 3. SAP Retrieve action to retrieve data from a SAP OData object.
      SAP Retrieve action to retrieve data from a SAP OData object.

      (Click image to view full size.)

    5. Click the (+) and then select Salesforce > Create order as the next action to be performed.
      If you haven't already connected a Salesforce account, click Connect and follow the instructions to allow App Connect to connect to your Salesforce account.
    6. Configure values for the required fields, and any optional fields that you want to use when creating a new Salesforce order
      For example:
      • For *Contract ID, type the ID value of a specific contract (to use that ID for all orders handled by this flow)
      • For *Account ID, select the SAP BookingCollection field Agency No (to use the value retrieved from SAP)
      • For *Order Start Date, select the SAP BookingCollection field Booking date
      • For Status, enter the value Draft
      Figure 4. Salesforce Create Order action using OData value retrieved from SAP.
      Salesforce Create Order action using OData value retrieved from SAP.

      (Click image to view full size.)

  4. Click the (+) and then select Asana > Create task as the next action to be performed.
    If you haven't already connected an Asana account, click Connect and follow the instructions to allow App Connect to connect to your Asana account.
  5. Select the Asana project in which to create new tasks.
  6. Configure a value for Task name.
    You can type text and select fields from the Eventbrite event and the other actions. For example:
    New Eventbrite order [Order ID] for [Passenger Name] added to Salesforce order ID [Order ID], Start date [Booking date]
    

    where […] indicates fields selected from Eventbrite, SAP, and Salesforce.

    Figure 5. Asana Create task action using OData values retrieved from SAP.
    Asana Create task action using OData values retrieved from SAP.

    (Click image to view full size.)

Start the flow

  1. From the banner, open the options menu [⋮] and click Start flow. Then click Dashboard to exit the flow.
    Your flow is displayed on your Dashboard and is listening for your event – the addition of a new order in Eventbrite.
    Figure 6. Flow running on the dashboard, ready for events
    Flow running on the dashboard, ready for events

Results

Congratulations, you have created a flow so that every time a new order is created in Eventbrite, data is retrieved from SAP and used to enhance the creation of an order in Salesforce and a task in Asana.

What to do next

To test your flow, create a new order in Eventbrite, as follows:

  1. Use Eventbrite to create a new order for an event managed by the account that you configured in App Connect.
  2. Add values for Company, First Name, Last Name, and Email, and then complete the registration for the new order.
  3. Log in to Salesforce with the account that you configured in App Connect, and then select the Order tab. You should see a new order that App Connect has created for the Eventbrite registration. If you view the detail for the Salesforce order, you can see that Account name has the value assigned from the SAP BookingCollection field Agency No, and Order Start Date has the value assigned from the SAP BookingCollection field Booking date.
  4. Log in to Asana with the account that you configured in App Connect, and then display the board that you also configured. You should see the new task that App Connect created for the Eventbrite registration, using the Passenger Name and Booking date values retrieved from SAP and other values from Eventbrite and Salesforce that you configured in the flow.
Figure 7. Flow result – SAP OData used in Salesforce order and Asana task created by the flow.
Flow result – SAP OData used in Salesforce order and Asana task created by the flow.