<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CodingSalesforce</title>
    <description>The latest articles on DEV Community by CodingSalesforce (@codingsalesforce).</description>
    <link>https://dev.to/codingsalesforce</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F84115%2F13d71518-9105-4ae6-aa77-a77c8b60b446.png</url>
      <title>DEV Community: CodingSalesforce</title>
      <link>https://dev.to/codingsalesforce</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codingsalesforce"/>
    <language>en</language>
    <item>
      <title>Salesforce Data Integration using Heroku Connect</title>
      <dc:creator>CodingSalesforce</dc:creator>
      <pubDate>Tue, 25 Jan 2022 02:28:53 +0000</pubDate>
      <link>https://dev.to/codingsalesforce/salesforce-data-integration-using-heroku-connect-5jf</link>
      <guid>https://dev.to/codingsalesforce/salesforce-data-integration-using-heroku-connect-5jf</guid>
      <description>&lt;p&gt;This blog will provide a high-level overview of how I used Heroku Connect to bring data to a Heroku app built with Lightning Web Component Open Source. I will go over the definition, the setup, configurations, and the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Heroku Connect
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Heroku Connect is an add-on that synchronizes data between your Salesforce organization and a Heroku Postgres database. Using Heroku Connect with Heroku Postgres, you can build custom applications that interact with your Salesforce data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;I created a simple app to showcase a list of puppies available for sale.  I used Lightning Web Components Open Source and Salesforce Design System.  I set up a simple Express server, connected postgres using URI, and used node-postgres to query the database. The app was deployed to Heroku. &lt;/p&gt;

&lt;p&gt;In Salesforce, I created a custom object to store information about the puppies such as age, name, and breed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;I logged in to the Heroku dashboard, navigated to resources, and selected two add-ons: Heroku connect and Heroku Postgres to use as a database. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--swVIuSsV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/aZoFHSK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--swVIuSsV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/aZoFHSK.png" alt="heroku dashboard" width="880" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, I mapped my custom objects and necessary fields.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y6PWuco1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/eOoM3Sp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y6PWuco1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/eOoM3Sp.png" alt="heroku mapping" width="880" height="141"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then restarted the app to apply the changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;After following all steps listed above, I was able to view the Salesforce data in my app.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--34FhdKWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/ZxXkXb4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--34FhdKWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/ZxXkXb4.png" alt="puppies gallery" width="880" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I logged in to Salesforce, updated the second puppy's name from Berlin to Rio. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eSUKAOtx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Djal5Mi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eSUKAOtx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/Djal5Mi.png" alt="puppies images" width="390" height="105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the change, I opened the Heroku app and the name change was reflected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LbnVsmF5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/ip8JTef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LbnVsmF5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/ip8JTef.png" alt="puppies images after" width="880" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By utilizing Heroku connect, I was able to replica my Salesforce data and display it on a public website for all users to see. While the use case that I explored only needed one-way communication, Heroku connect also has bidirectional data replication. This is useful in cases where users need to create or update information stored in Salesforce. To learn more and view limitations, refer to the documentation &lt;a href="https://devcenter.heroku.com/articles/heroku-connect"&gt;Heroku&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>salesforce</category>
      <category>heroku</category>
      <category>lwc</category>
    </item>
  </channel>
</rss>
