Creating a contact record in an Oracle table when a new lead is created in Salesforce

Learn how to use IBM® App Connect to create an event-driven flow such that when a new lead is created in Salesforce, a contact record is automatically created in the Oracle contact table. This tutorial demonstrates how you can easily create a flow by specifying information in a simple manner.

Note: This document assumes that you have signed up for free or trial accounts with Salesforce and Oracle Database, or that you have business accounts.

Scenario

Say you are using Salesforce to manage customer relationship management and Oracle database as enterprise resource planning. You want to sync your Salesforce leads with your Oracle contact table.

Figure 1. Event-Driven flow to create a contact record in Oracle table when a new lead is created in Salesforce

(Click image to view full size.)

First, find or create everything you need:

  1. An IBM App Connect subscription.
  2. Obtain account details for connecting IBM App Connect to your applications:
    • For Salesforce, you need user ID and password credentials to connect. If you want to create a free Salesforce account to test IBM App Connect, make sure that you create a Developer account rather than a Trial account. For more information, see How to use IBM App Connect with Salesforce
    • For Oracle Database, you need the Oracle database server host name, port, user ID, password, database name, and schema name. If you are not the owner or administrator of your Oracle instance, you can obtain this information from your Oracle administrator.
      Note: Only Oracle Database 11g and Oracle Database 12c are supported for use with App Connect.
  3. If the Oracle database server is in a private network (for example, behind a firewall in your on-premises data center), you'll need to set up a gateway that App Connect will use to securely access the Oracle database server. You can use the IBM Secure Gateway Client to set up the required network connection for accessing protected data.

    If you've previously used the Secure Gateway Client to set up a network connection for an App Connect application that is on the same private network as the Db2® server, you can use this network connection with Db2.

    For detailed information about configuring a network connection by using the IBM Secure Gateway Client, see Configuring a private network for IBM App Connect on IBM Cloud®

Next, create your flow:

Using the IBM App Connect Designer authoring experience, complete the following steps to create your flow from scratch.

  1. Log in to IBM App Connect Designer; for example, launch IBM App Connect through your IBM Cloud dashboard.
  2. From the Dashboard, click NewEvent-driven flow.
  3. Complete the following steps. As you progress, IBM 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.

  4. Enter a name that identifies the purpose of your flow; for example: Create Contact in Oracle table for each Salesforce Lead
  5. Select SalesforceNew lead as the event that is to trigger the flow.
  6. Click the (+) and then scroll down to Oracle Database.
  7. Select Oracle DatabaseShow MoreCreate CONTACT Record as the action.
    Figure 2. Oracle Database / Create CONTACT record action
    Oracle Database / Create CONTACT record action

    (Click image to view full size.)

  8. Map the Create CONTACT Record fields with the response from Salesforce lead object
  9. Figure 3. Oracle Database / Create CONTACT Record field mappings

    (Click image to view full size.)

  10. 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 contact in Salesforce.
    Figure 4. The flow tile on the Dashboard, showing that the flow is running and listening for events
    The flow tile on the Dashboard, showing that the flow is running and listening for events

    (Click image to view full size.)

Finally, test your flow:

  1. Log in to Salesforce using the account that you configured in IBM App Connect.
  2. Create a new Salesforce lead, and save the lead.
    Figure 5. Creating a new lead in Salesforce
    New lead created in Salesforce

    (Click image to view full size.)

  3. After a short while, check your Oracle Contact Table.
    Figure 6. Oracle table, showing contact added from the Salesforce lead
    Oracle table, showing contact added from the Salesforce lead

    (Click image to view full size.)

  4. Examine the IBM App Connect Dashboard. If the flow ran successfully, the flow tile shows a green tick
Figure 7. Flow tile showing the last successful run of the flow
Flow tile showing the last successful run of the flow

(Click image to view full size.)

Conclusion

Congratulations, you have created a flow that is triggered when a new lead is added to Salesforce, and it creates a contact record in Oracle Database table.