Start tracking your progress
Trailhead Home
Trailhead Home

Provision the Heroku Connect Add-On

Set Up Your Trailhead Playground

Before we can provision the Heroku Connect Add-on, there are a few things to do to set up your Trailhead Playground to be ready to configure Heroku Connect.

First, scroll to the bottom of this page and click Launch to open your Trailhead Playground. Next, follow the instructions in Get Your Trailhead Playground Username and Password unit of the Trailhead Playground Management module. You'll need your username and password to provision your Heroku Connect Add-on.

Next add a new field to the Contact Object:

  1. In Setup, click the Object Manager next to the Home.
  2. Click the Contact.
  3. Click Fields & Relationships.
  4. Click New.
  5. For Data Type, select Text, and click Next.
  6. Complete the custom field as follows:
    • Field Label: External Phone ID
    • Length: 10
    • Field Name: External_Phone_ID
    • Unique: Select Do not allow duplicate values
    • External ID: Select Set this field as the unique record identifier from an external system
  7. Click Next.
  8. Check the Visible box to make the field visible to all profiles, and click Next, and then Save.

We're done with Salesforce for a while, but keep this tab handy!

Provision the Heroku Connect Add-On

Applications running on Heroku can use a number of different methods to integrate with Salesforce data, including the Salesforce REST APIs. An easier approach is to use the Heroku Connect add-on.

Heroku Connect provides bidirectional synchronization between Salesforce and Heroku Postgres, allowing you to unify and share the data in a Heroku Postgres SQL database with the contacts, accounts, and other custom objects in a Salesforce database.

In this section, you provision the Heroku Connect add-on and sync your Salesforce Contacts to the Heroku Postgres database provisioned in the previous step.

  1. Go to the Heroku Dashboard, then find your application and click the link.
  2. Click the Resources tab.
  3. In the search area in the Add-ons section, type Heroku Connect, click Enter, and then click Provision.
  4. Click the newly added Heroku Connect add-on to configure the syncing, and click Setup Connection.

The Heroku Connect Provision Connection screen appears.

Create Connection

Heroku Connect locates the Heroku Postgres database that you provisioned in the previous step.

  1. Click Next and then click Authorize

Now set up Heroku Connect.

  1. Authorize Heroku Connect to access your Salesforce org. Log in to Salesforce with your Trailhead Playground credentials you collected above.

Salesforce OAuth

  1. Create a mapping between the Contact object in Salesforce and a table in the Heroku Postgres database.
    1. In Heroku, click Mappings and click Create Mapping. Create Mappings
    2. Select the Contact object.
    3. In the Database -> Salesforce section, select the Write database updates to Salesforce using -- None -- as the unique identifier option and choose External_Phone_ID__c from the dropdown list.
    4. In the Mapped Fields section, select the following fields:
      • Created Date
      • Email
      • FirstName
      • HomePhone
      • LastName
      • MobilePhone
      • Name
      • Phone
        Mapping Fields
    5. Click Save.
  2. When you've completed the mapping setup, the data begins synchronizing. Mapping Complete

Your application is now syncing (bidirectionally) a subset of the Contact object in Salesforce with a new table in the Heroku Postgres database associated with your app.

When the syncing is complete, open your Heroku app in a new browser tab, by entering and replacing APP_Name with your app name

Create Connection

  1. Complete the form to change a contact's phone number using the following values:

    • First Name: Tim
    • Last Name: Barr
    • Email:
    • Phone: (415) 555-1212
  2. Click Update Phone Number.

This will submit the form and update the contact record in the Heroku Postgres database. Since you had previously setup the bidirectional sync with Salesforce using Heroku Connect, this should also automatically update the contact record in Salesforce.

Verify these updates in your Trailhead Playground.

  1. Click App Launcher icon and select Sales.
  2. Click the Contacts tab.
  3. Click Recently Viewed and select All Contacts.
  4. Click Tim Barr and then click the Details tab and see that both the Phone and Mobile fields display the new value.

Syncing could take a few minutes so ensure your Trailhead Playground is updated, before clicking Verify Step below.