AnsweredAssumed Answered

Multiple Postgres records to one Salesforce record

Question asked by tom.kline365190 on May 10, 2018
Latest reply on May 16, 2018 by tom.kline365190

Hi all -

 

I'm encountering a scenario where I need to take multiple product records from a postgres database, and map their values to a single Salesforce.com account record.  I'm currently having trouble figuring out how to consolidate the rows returned in the postgres database profile, and create the mapping to push the attributes to the right Salesforce.com account fields.

 

To get more specific, my postgres profile returns the following attributes:

  • Company ID
  • Product Id
  • Product Name
  • Usage Count

 

Samples data returned would look like this:

 

Company IDProduct IDProduct NameUsage Count

TestCo

123Blue Widget15
TestCo456Red Widget20
AcmeCo123Blue Widget7
AcmeCo456Red Widget0

 

Each company will have one record for every product, and will return 0 in the Usage Count attribute if nothing is used.  

 

In Salesforce, I have one field on the account object for each Product, and I want to populate those fields with the Usage count attribute.  So the Salesforce account record (matched on the Company ID) would need to get updated based on the above postgres returned rows, but in this consolidated format:

 

Company IDBlue Widget Usage CountRed Widget Usage Count
TestCo1520
AcmeCo70

 

 

I know it's not an ideal architecture but it's what I'm stuck with for the time being.  Any ideas or best practices on how I can achieve this?

 

Thanks!

Outcomes