đź“Ł Attention Salesforce Certified Trailblazers! Link your Trailhead and Webassessor accounts and maintain your credentials by December 14th. Learn more.
close
trailhead

Set Up Heroku Connect

Set the unique identifiers for the DreamHouse app.

Currently, we have a properties listing on our DreamHouse app. This information is displayed only from the Postgres add-on we provisioned in the previous step. To see the properties you imported into your Trailhead Playground, we need to establish a connection between your Trailhead Playground and your Heroku Postgres database by creating mappings.

    The Heroku Connect icon with two bi-directional arrows on the left and the right. The Heroku icon is connected to the Heroku Connect icon on the left with a screenshot of the Dreamhouse app displayed on iOS and a Mac. The Salesforce icon is connected to Heroku connected on the right with a monitor displaying the dreamhouse data in an org.

  1. In your Trailhead Playground, go to Setup and select Object Manager.
  2. Click Broker and select Field & Relationships.
  3. Click Email and click Edit.
  4. Select Unique and External ID.
  5. Click Save.
  6. Click the Object Manager tab. Scroll down and click Property.
  7. Select Field & Relationships.
  8. Click Address and click Edit.
  9. Select Unique and External ID.
  10. Click Save.
  11. Keep this tab open.

Add Heroku Connect.

  1. Go to your Heroku Dashboard, https://dashboard.heroku.com.
  2. Click your new DreamHouse dev app, dhdev-UNIQUE_ID.
  3. Click Resources on the Heroku dashboard.
  4. In the Add-ons field, type connect. Select Heroku Connect and then click Provision.
  5. After adding Heroku Connect, click Heroku Connect and it opens a new tab.
  6. Click Setup Connection.
  7. Click the schema name input and verify the text says salesforce, click Next.
  8. Click Authorize.
  9. Using your Trailhead credentials we reset in Step 1, authorize your account.
  10. Click Allow.

Once you authorize Heroku to access your Trailhead Playground, you’re redirected to the Heroku Connect dashboard.

Create Heroku mappings.

  1. Click the Mappings tab and select Create Mapping.
  2. In the search bar, type prop and select Property__c.
  3. Select Accelerate Polling.
  4. Select Write data updates to Salesforce…. In the dropdown, select the unique identifier we set in our Trailhead Playground, Address__c.
  5. Select the checkbox for Address__c, Baths__c, Beds__c, Broker__c, City__c, CreatedDate, Description__c, Location_Latitiude__s, Location_Longitude__s, Name, Picture__c, Price__c, State__c, Status__c, Thumbnail__c, Title__c, and Zip__c.
  6. Click Save.
  7. Click Create Mapping.
  8. Type brok and select Broker__c.
  9. Select Accelerate Polling.
  10. Select Write data updates to Salesforce… In the dropdown, select the unique identifier we set in our Trailhead Playground, Email__c.
  11. In the Mapped Fields section, check Created Date, Email__c, Mobile_Phone__c, Name, Phone__c, Picture__c, Title__c.
  12. Select Save.
  13. Click Create Mapping.
  14. Type fav and select Favorite__c.
  15. Select Accelerate Polling.
  16. In the Mapped Fields section, check CreatedDate, Name, Property__c, User__c.
  17. Select Save.
  18. After you click save, you’re redirected to the Mappings tab.

Displays the Heroku Connect Dashboard with mappings for the Broker, Favorite and Property.

Restart the app to poll Heroku Connect for new data.

  1. Return to the DreamHouse dashboard, http://dashboard.heroku.com.
  2. Click your DreamHouse app, for example, dhdev-UNIQUE_ID
  3. Click More.
  4. Restart all dynos.

Verify the app is up and running.

  1. Click More.
  2. Click View Logs. Once the restart is complete, you should see two lines saying, State changed from starting to up.
  3. Click Open App to reload the running app. Take note of the DreamHouse URL in your browser, for example, https://dhdev-UNIQUE_ID.herokuapp.com/.
  4. Select the menu icon Dreamhouse Menu Icon and click Properties.

  5. Note

    Note

    Just like earlier, you see a list of properties for sale. In addition to the 12 properties stored in PostgreSQL, the additional properties stored in your Trailhead Playground are also replicated and shown in your DreamHouse web app.

  6. Open the property titled Waterfront in the City.
  7. Scroll down and take note of the Asking Price.

Screenshot highlighting the Asking Price ($850,000) for Waterfront in the City.

Test Heroku Connect by changing the values in your Trailhead Playground

  1. Return to your Trailhead Playground. Click the App Launcher and select DreamHouse.
  2. Go to the Properties tab and select the Property Name, 211 Charles Street.
  3. Click the edit pencil next to Price to edit. Change the price to $800,000.

    Screenshot of the Property record for Waterfront in the City. The Property Title and Property Name (211 Charles Street) is highlighted.
    Screenshot of the Edit Options. Price is selected and 800,000 is entered in the text box for price.

  4. Click Save.
  5. Navigate back to your DreamHouse app, https://dhdev-UNIQUE_ID.herokuapp.com/.
  6. Select the menu icon.
  7. Click Properties.
  8. Open the property titled Waterfront in the City.
  9. Scroll down and see that the price changed to $800,000.
retargeting