Topics

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:

In Setup, click the Object Manager next to the Home.

Click the Contact.

Click Fields & Relationships.

Click New.

For Data Type, select Text, and click Next.

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

Click Next.

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.

Create a mapping between the Contact object in Salesforce and a table in the Heroku Postgres database.

In Heroku, click Mappings and click Create Mapping.

Select the Contact object.

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.

In the Mapped Fields section, select the following fields:

Created Date

Email

FirstName

HomePhone

LastName

MobilePhone

Name

Phone

Click Save.

When you've completed the mapping setup, the data begins synchronizing.

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 http://APP_NAME.herokuapp.com and replacing APP_Name with your app name

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

First Name: Tim

Last Name: Barr

Email: barr_tim@grandhotels.com

Phone: (415) 555-1212

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.

Click and select Sales.

Click the Contacts tab.

Click Recently Viewed and select All Contacts.

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.