Learn how to use App Connect Designer to create an event-driven flow that when someone registers for an event in Eventbrite, creates a lead in SugarCRM and sends the attendee an email depending on whether or not they are an existing lead.

Note: This tutorial assumes that you have signed up for free or trial accounts for Eventbrite, SugarCRM, and Google Mail, or that you have business accounts.

Additional reference:

Scenario:

Your company is using Eventbrite for its event management tasks and wants to publicize an expo to promote the latest product range and offer tickets for the event. Whenever an attendee registers for the expo in Eventbrite, the CRM team want App Connect Designer to help them pursue possible sales opportunities, by automatically adding the attendee as a lead in SugarCRM … but only if they are not an existing lead. The Marketing team also want to send the attendee information about future promotions or additions to the product range, with different email content for new leads and for existing leads.

Event-driven flow to create a SugarCRM lead for an Eventbrite attendee only if they are not already a lead, and to send an appropriate email. (Click image to view full size.)

First, find or create everything you need:

  1. An App Connect subscription.
  2. Obtain account details for connecting App Connect to your applications (If you haven’t already connected App Connect to your applications.):
    • The email address and password of your Eventbrite and Gmail accounts
    • The following settings for SugarCRM:
      • Client ID (SugarCRM Consumer Key value)
      • Client secret (SugarCRM Consumer Secret value)
      • User ID (SugarCRM User Name value)
      • Password
      • Host name

      For more information about how to find the required values, see How to use IBM App Connect with SugarCRM

    • An event in Eventbrite (you can create a private event with free tickets for test purposes).

Next, create your flow:

You can create your flow by importing the sample flow document from GitHub, or by creating your flow from scratch.

Creating the flow from the sample flow document

This enables you to create the flow immediately, and then select each node in the flow to validate the node and select the application accounts that you want to use.

Creating the flow from scratch

This helps you to learn the sequence of steps used to create the flow, and to examine the nodes and fields as you go.

  1. Log in to App Connect Designer; for example, launch App Connect through your IBM Cloud dashboard.
  2. From the Dashboard, click New > Event-driven flow.

    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.

  3. Enter a name that identifies the purpose of your flow; for example: EV attendee to SugarCRM lead and email.
  4. Select Eventbrite > New attendee as the event that is to trigger the flow.

    If you have not connected App Connect to Eventbrite, allow App Connect to access your Eventbrite account (in a separate tab).

  5. Click the (+) and then scroll down to SugarCRM.
    Flow triggered by Eventbrite / New attendee event, with SugarCRM listed for the first action. (Click image to view full size.)

    Select SugarCRM > Retrieve leads as the action that App Connect should use to try to retrieve a lead record for the attendee from SugarCRM.

    If you have not connected App Connect to SugarCRM, click Connect and then complete and submit the form with the SugarCRM account details that you obtained above.

    Specifying details to connect to SugarCRM. (Click image to view full size.)
  6. Configure the conditions for retrieving a lead record for the attendee:
    1. A lead record should be retrieved if it has the attendee’s first name, last name, and email address.
      1. Click Add condition and then select the field First Name. (You can scroll to the field or start typing firs in the Search field.)
      2. Leave the condition as equals.
      3. In the right field, start typing firs, and then select the Eventbrite First name field.

      Repeat this for the other two conditions: Last Name equals Last name; and Email address equals Email.

    2. We only want to check if there exists a lead record for the attendee, so only need to retrieve one lead record. (This avoids potential issues if SugarCRM contains multiple lead records for the attendee.)

      Leave “Maximum number of items to retrieve: 1” (the default). For “If the limit is exceeded:”, select the option “Process 1 item from the collection”.

    3. If a lead record does not exist, we want App Connect to continue the flow and issue a ‘204: No content’ response code, so that the flow can create a lead record for the attendee.

      For “If no items are found:”, select the option “Continue the flow and issue a ‘204: No content’ response code”.

    Options chosen to handle the number of leads retrieved from SugarCRM. (Click image to view full size.)
  7. Configure the flow to test if no SugarCRM lead record was found for the attendee, and to provide alternative branches for more actions.
    1. Click the (+) and then click Toolbox
      The Toolbox tab showing the If (conditional) node and other tool nodes for modifying flow behaviour. (Click image to view full size.)
    2. On the Toolbox tab, click If (Conditional) to add an If node to the flow and open the If node editor.
    3. Add the condition to test for the 204 response code:
      1. Click in the first field, and then click the “Insert a reference” icon
      2. Click “Sugar CRM / Retrieve Leads Response”, and then select the Status code field.
      3. Leave the test as “eq…” (equals; the default)
      4. In the second field, type 204
      Selecting the response code of the SugarCRM Retrieve leads action for use in the If node. (Click image to view full size.)
    4. Close the If node editor (Click the X, Close icon.)
  8. On the first branch of the If node, configure what should happen if App Connect discovers that no SugarCRM lead exists for the attendee.
    1. Click the (+) and then scroll to and select SugarCRM > Create lead as the action that App Connect should use to create a lead record in SugarCRM.
    2. (Optional) In the Description field, add text and field values that could be useful to someone handling the new lead record; for example:
      New lead from Eventbrite attendee ID [Attendee ID] (Event ID: [Event ID])

      Where, [Attendee ID] and [Event ID] are field selected from Eventbrite / New attendee.

    3. (Optional) In the First Name field, start typing “firs” and then select the First name field from Eventbrite / New attendee.
    4. In the Last Name field, start typing “las” and then select the Last name field from Eventbrite / New attendee.
      Mapping Eventbrite attendee fields to fields of the SugarCRM create lead action. (Click image to view full size.)
    5. (Optional) In the Email address field, start typing “email” and then select the Email field from Eventbrite / New attendee.
    6. (Optional) In the Website field, start typing “Webs” and then select the Website field from Eventbrite / New attendee.
    7. Close the New lead editor (Click the X, Close icon.)
    8. Click the next (+) on the same branch and then scroll to and select Gmail > Create message. This will be used to send an email message to a new lead.

      If you have not connected App Connect to Gmail, click Connect to Gmail and then allow App Connect to access your Gmail account (in a separate tab).

    9. In the To field, start typing “email” and then select the Email field from Eventbrite / New attendee.
    10. In the Subject field, type text and select fields to form a suitable subject; for example: Check out our new offering IBM App Connect
    11. In the Body field, type text and select fields to form a suitable message body; for example: New lead (prospective customer) - Redirect to product page - https://www.ibm.com/us-en/marketplace/app-connect
      Specifying fields of the Gmail / Create message action for a new SugarCRM lead. (Click image to view full size.)
    12. Close the Create message node editor (Click the X, Close icon.)
  9. On the second branch of the If node, configure what should happen if App Connect discovers that there is a SugarCRM lead for the attendee.
    1. Click the (+) on the second branch and then scroll to and select GMail > Create message. This will be used to send an email message to an existing lead, using the same Gmail account to send the message.
    2. In the To field, start typing “email” and then select the Email field from Eventbrite / New attendee.
    3. In the Subject field, type text and select fields to form a suitable subject; for example: More good stuff added to App Connect! - See what's new
    4. In the Body field, type text and select fields to form a suitable message body; for example: Existing lead - See what's new in App Connect: https://developer.ibm.com/integration/docs/app-connect/whats-new-ibm-app-connect/
      Specifying fields of the Gmail / Create message action for an existing SugarCRM lead. (Click image to view full size.)
    5. Close the Create message node editor (Click the X, Close icon.)
  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 attendee in Eventbrite.
    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:

To test the flow, you can assume various roles: that of a CRM team member, a Marketing team member, and an individual (external to your company) who wants to register for the expo.

  1. [CRM team member]: Log in to SugarCRM using the account that you configured in App Connect and verify that no lead exists for Anne Other (or whatever name you want to use for testing).
  2. [Marketing team member]:
    1. Log in to Eventbrite using the account that you configured in App Connect.
    2. Create a free and private event, and enter sample values for any mandatory fields.
    3. Make the event live so that people can register to attend.
    4. Go to the Event Dashboard for the event and make a note of the event URL, which is shown at the bottom of the page.
  3. [Event attendee]:

    Use the event URL, register for the event by completing the following fields for a name and email address that are not used by a SugarCRM lead (to test the first branch of the If node in the App Connect flow):

    • First Name: Anne
    • Surname: Other
    • Email Address: This is the email address that messages will be sent to by App Connect.
    • Company / Organization Another Enterprises
    • Website http://another.com
    Eventbrite / New attendee submitting the registration form to trigger the flow. (Click image to view full size.)
  4. After a short while, examine the App Connect Dashboard. If the flow ran successfully, the flow tile shows a green tick
    The flow tile on the Dashboard, showing that the flow has run successfully. (Click image to view full size.)
  5. [CRM team member]: Log in to SugarCRM using the account that you configured in App Connect and verify that a lead exists for Anne Other.
    New SugarCRM lead created by App Connect flow. (Click image to view full size.)
  6. [Event attendee]: Log in to the email account that you specified when you registered with Eventbrite. Then verify that you received the event order emails from Eventbrite and an email from the Gmail account used by App Connect. Optionally, open the email from App Connect, which should have the Subject and Body for a new lead in SugarCRM.
    Email message sent by the App Connect flow to the Eventbrite attendee as a new lead in SugarCRM. (Click image to view full size.)
  7. Now test the second branch of the flow used when the Eventbrite attendee is already a lead in SugarCRM. To do this, you can register as an Eventbrite attendee with the same details as before:
    1. [Event attendee]:

      Use the event URL, register for the event by completing the following fields for a name and email address that were used before to create the SugarCRM lead:

      • First Name: Anne
      • Surname: Other
      • Email Address: This is the email address that messages will be sent to by App Connect.
      • Company / Organization Another Enterprises
      • Website http://another.com
    2. After a short while, examine the App Connect Dashboard. If the flow ran successfully, the flow tile shows a green tick (and a later time than the previous successful run).
    3. [CRM team member]: Log in to SugarCRM using the account that you configured in App Connect and verify that no new duplicate lead exists for Anne Other.
    4. [Event attendee]: Log in to the email account that you specified when you registered with Eventbrite. Then verify that you received the event order emails from Eventbrite and an email from the Gmail account used by App Connect. Optionally, open the email from App Connect, which should have the Subject and Body for an existing lead in SugarCRM.
      Email message sent by the App Connect flow to the Eventbrite attendee as a new lead in SugarCRM. (Click image to view full size.)

Congratulations, you have created a flow that is triggered when someone registers to attend your company’s expo (Eventbrite event). The flow checks if the attendee is a lead in SugarCRM and then takes further action depending on if the attendee is an existing lead in SugarCRM:

  • For a new lead, adds the attendee as a new lead and sends them an email suitable for a new lead.
  • For an existing lead, sends the attendee an email suitable for an existing lead.

Join The Discussion

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