Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Salesforce - The Power of Upsert and External IDs


Published on

You’re probably already familiar with insert and update operations. Insert always creates new records whereas update makes changes to existing records that you already know their Salesforce record id.

But what if you don’t know the Salesforce record id of the records you want to update?

Learn about the Power of Upsert and External IDs in this presentation based on my blog post series:

Published in: Technology
  • Be the first to comment

Salesforce - The Power of Upsert and External IDs

  1. 1. #MWD16
  2. 2. Midwest Dreamin’ Platinum Sponsors #MWD16
  3. 3. #MWD16 Midwest Dreamin’ Gold Sponsors
  4. 4. The Power of Upsert and External IDs Salesforce Data Integration Techniques #MWD16
  5. 5. Senior Developer/Architect Virsys12 @DouglasCAyers #MWD16
  6. 6. An award-winning Silver Consulting Partner focused on healthcare innovation
  7. 7. #MWD16 Health Systems ACO & Population Management Behavioral Health Ancillary Providers & Healthcare Service Providers
  8. 8. External Data Integration • Scenario ▫ When Salesforce is not the “System of Record” • Concerns ▫ How to prevent creating duplicates in Salesforce? ▫ How to create parent records then link child records? #MWD16 ERP OMS EMR HCM
  9. 9. Traditional Approach #MWD16 Export Records VLOOKUP to Match Insert Non-Matches Update Matches 1 2 3
  10. 10. Traditional Approach #MWD16 Export Parent Records VLOOKUP to Match 1 2 Export Existing Records VLOOKUP to Match Insert or Update 3 4 5
  11. 11. Traditional Approach #MWD16 1 2 3 4 5 6 7
  12. 12. #MWD16 How you feel juggling all the files…
  13. 13. #MWD16 How you feel when it goes wrong…
  14. 14. #MWD16 Tedious Error Prone Doesn’t Scale Traditional Approach
  15. 15. Did he say ‘upsert’?? • Insert ▫ Always creates new records • Update ▫ Makes changes to records you know their Salesforce ID • Upsert ▫ Inserts or Updates based on existence of the record ▫ Matches on External ID field #MWD16
  16. 16. #MWD16
  17. 17. First, you need External IDs #MWD16
  18. 18. First, you need External IDs • Supported Custom Field Data Types ▫ Auto Number, Number, Text, Email • Determine Record Identifiers from External Systems ▫ Order Numbers, Patient IDs, Employee IDs, … • Super Power: Field becomes Searchable and Indexed ▫ SOQL performance! #MWD16
  19. 19. Upsert Benefits • Simplifies insert/update operations! • Do not have to know Salesforce IDs! • Do not have to export and match on existing records! • Helps prevent duplicates! • Fewer API calls needed! • Can set lookup fields too! #MWD16
  20. 20. Live Demo Time • Create External ID • Salesforce Data Import Wizard • MuleSoft • Salesforce Data Loader • Workbench • Apex Code #MWD16
  21. 21. Best Practices • Mark External IDs as Unique • Use Compound Values for Uniqueness #MWD16 “Hospital-100 Patient-123” “Hospital-200 Patient-123”
  22. 22. Use Case: Populating Sandboxes • Create Salesforce Migration ID field in production ▫ Unique, Case-Sensitive, External ID • Create Sandbox or Deploy New Fields • Export Data from Production • Import Data to Sandbox ▫ Upsert matching on Salesforce Migration ID ▫ Map exported ID field to Salesforce Migration ID #MWD16
  23. 23. Use Case: Multiple Source Systems • Invest in Master Data Management ▫ MDM Strategy Dreamforce Video • Upsert Salesforce by MDM External ID ▫ Store related system ids as other fields • Benefits ▫ Mashups with Canvas apps ▫ Deep linking to related systems ▫ More context on layouts & reports #MWD16
  24. 24. ETL: Advanced Data Loading • Upsert with Talend and Populating Sandboxes • MuleSoft Salesforce Connector • Upsert with Jitterbit • Upsert with Informatica and User Guide • IBM DataStage and IBM Cast Iron • Dell Boomi Salesforce Connector • V12 Connect by Virsys12 & Trinisys #MWD16
  25. 25. Further Reading • My Blog Posts: Part 1 and Part 2 • Data Import: Cleaning Up Your Import File • Red Argyle: VLOOKUP Explained • Salesforce University: Integrating with SOAP API • Apex Developer Guide: Upserting Records • Jeff Douglas: Using External IDs in Salesforce • Jitendra Zaa: All About Upsert and External ID #MWD16
  26. 26. Questions Doug Ayers @DouglasCAyers The Power of Upsert and External IDs
  27. 27. #MWD16