If you haven’t signed up yet, check my previous blog and complete the process.

All set? Let’s do some hands on:

Provision the Heroku Postgres and Heroku Connect Add-On

In this step, you provision a relational database by adding the Heroku Postgres add-on.

  1. Click the Manage App button to visit the Heroku Dashboard and click on your new application.
  2. Click the Resources tab.
  3. In the search area in the Add-ons section, type Heroku Postgres, click Enter, and then click Provision.
  4. Now type Heroku Connect > click Enter > click Provision.
  5. Click the newly added Heroku Connect add-on to configure the syncing, and click Setup Connection.

The Heroku Connect Provision Connection screen appears.


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

  1. Click Next > click Authorize, log in to Salesforce and authorize your app.
    You have now established a connection between the Salesforce Org and your Heroku Postgres database.
  2. Now, create a mapping that instructs Heroku Connect, which Salesforce Objects to sync to Heroku Postgres, and whether the sync is bi-directional or not.
    1. Click on Create Mapping
    2. Select the Account
    3. In the “Mapped Field” list, select the following 5 fields(Name, Phone, ShippingCity, ShippingCountry, Type) as shown in below screen in addition to the default fields that Heroku Connect automatically requires:
    4. Click Save

When you’ve completed the mapping setup, the data begins synchronizing. The Heroku Connect panel will now show you a successful sync:


In this step, you configured Heroku Connect to create a uni-directional sync that maps Account data in your Salesforce org, to a table in the Heroku Postgres database attached to your app. You can also configure it for bi-directional mapping which would allow you to create new records in the Heroku app, and have those automatically sync across to your Salesforce org.

Create a Heroku Postgres Dataclip

Dataclips let you easily share the results of SQL queries on a Heroku Postgres database. Because your app now syncs Salesforce data to a Heroku Postgres database, you can make use of Dataclips.

Select your app in the Heroku Dashboard, and choose the “Resources” tab. You’ll see the add-ons for your application listed:

Click the disclosure buttons on the right hand side of the Heroku Postgres add-on, and then click Create Dataclip.

In the title field, type “All Accounts”, and for the SQL query, copy the text below, and then, click the Create Dataclip button.

SELECT

Name, Phone, ShippingCity, ShippingCountry, Type

FROM

salesforce.account

ORDER BY systemmodstamp DESC;

Heroku Dataclips runs the query and displays the results.

Your Heroku Postgres database is automatically kept up to date by Heroku Connect. It’s all dynamic, so if you go and modify your Account data in the connected Salesforce org, and then check the query result, you’ll see the changes (after the default sync period).

#HappyLearning