Site iconAxway Blog

Create a Simple Integration Builder Flow

Integration Builder and HubSpot

In this blog, we’ll build a simple Integration Builder flow which monitors HubSpot CRM for new contacts. If a new contact is created in HubSpot, the flow will automatically create the same contact in Salesforce Sales Cloud. We’ll demonstrate the following key functions of the Integration Builder platform:

  1. Authentication with external services
  2. Data mapping
  3. Event triggers

Prerequisites

You’ll need the following for this tutorial:

Note: You will need to log into your Salesforce Developer account at least once before proceeding.  The initial login triggers the creation of the sandbox environment which will be used in this example.

Overview of steps

  1. Create instances of HubSpot CRM and Salesforce Sales Cloud connectors
  2. Build a data mapping to create a normalized representation of a Customer
  3. Configure your connector instances to use the mapping
  4. Configure the HubSpot CRM connector instance to poll for updates
  5. Build a flow template using the connector instances and mapping
  6. Create a flow instance that triggers when the HubSpot CRM connector instance polls for an update

Create Connector Instances

Create a mapping

Mappings can be used to create a normalized data model for use within Integration Builder.  In this example, we’ll use a mapping on the inbound call to map the HubSpot-specific data model into a custom data model, mapping only the fields we need and giving them convenient names for internal reference. The map will also be used on the outbound call to Salesforce where it will map the internal data model to the appropriate fields in the Salesforce data model.

Associate mapping with a Connector Instance

Test the mapping

Associate mapping with Salesforce Connector Instance

Field NameSalesforce Field
cityMailingCity
countryMailingCountry
emailEmail
firstNameFirstName
lastNameLastName
postalCodeMailingPostalCode
stateMailingState
streetMailingStreet

 

Inspect API Docs

Understanding the changes made to the API Docs by the mapper will help to explain values used when building the flow in the next section.

Note the GET /myContacts and GET /myContacts/{id} APIs. These will get all contacts from HubSpot or contacts based on the result of a query string. Looking forward to the flow, the trigger event will contain the id of any newly created contact. The flow will then call the GET /myContacts/{id} and retrieve the fields defined in the mapping from the new contact entry.

Examine the API docs for the Salesforce Connector Instance. The flow will use the GET /myContacts/{id} to check if a contact already exists and then the POST /myContacts to create a new contact.

Create a flow

Build the flow

Complete the flow logic

This flow has two true/false filters where we have covered the True condition. We should add graceful exits to the False conditions and capture the output. I’m not sure if it’s necessary, but I have found it useful to understand why the filter evaluated to False when examining the flow instance execution trace.

Create a Flow Instance

Now that we have a complete flow template, it’s time to create an executable instance. This is where the Connector Instance Variables in the template will be associated with specific Connector Instances.

Test the flow

Now would be a good time to set the polling interval of the HubSpot, in the instance of the HubSpot CRM connector to a low value if you haven’t done so already.

If you have a Flow Execution with a green createNewContact step, congratulations! Everything worked and you should have a new contact for Bob Smith in your Salesforce instance. If you get a red step, then it is time to do some troubleshooting. Click on the Steps to view their execution information and try to determine what went wrong.

In this blog, we demonstrated how to create Connector Instances and authenticate them against external services, define a custom Mapping to create normalized data model and build a flow to tie everything together. While this is a simple scenario, it provides an example that can be used in more complex situations.

Exit mobile version