Skip to main content

How to Guide - Salesforce Data Import: Step 2- Determine Insert Order

Determine Import Order


Importing Data to Salesforce using a Spreadsheet or .CSV Files

                                         
On the last post, we cleaned up data import files:
  1.  Removed duplicate records
  2. Merged multiple spreadsheets for the same object into one master spreadsheet per object.

    The data is nicely sorted, but we need to determine which order to use when uploading to Salesforce.  This is the most tricky step in a data upload operation. Why?
                           Order Matters!                
Data Import Steps:
2) Determine the Insert Order

The order for this data import:
  • 1st Group - Lead (Blue dot on diagram.)
Why? Leads are not connected to any of the other objects selected for import.  Plus, we can use the data upload wizard, which is simple and quick!
  • 2nd Group - (Purple dots)
    1) Account
    2) Contact
    3) Opportunity
    4) Opportunity Contact Role
    5) Quote
Why? Accounts must be uploaded before we can associate contacts with accounts.  The contacts and accounts are needed for opportunities.  Opportunity contact roles require the opportunity and contact. Finally, quotes are connected to opportunities and contacts.
  • 3rd Group - (Green dots)
    1) Asset
    2) Case
Why? Assets are related to accounts.  Cases are related to assets, contacts, and accounts.
Wow Trailhead Baby, that's great, but how do I determine the order?
Analytical?  Salesforce lists the entry relationship diagrams for standard objects, like the one shown above.  Objects are linked with the lines with related object ID's listed within each box.  If you are importing custom objects, understanding the relationships between the objects is key and can be very complicated.  Unless you are a wiz at graph theory, I recommend a third party tool like CopyStorm/Restore.

Salesforce Administrator?  You probably love to click, so a simple alternative is to open Salesforce and start clicking.  In a Trailhead Playground, I selected one of the pre-loaded accounts and made notes:

Contacts, Opportunities, and Cases all tie to Accounts.  Since you need an account to have a contact, it's logical to assume that accounts need to be entered first, then contacts.  This approach is great for simple data imports with relatively few dependencies - like today's example! 

Start with the feet.  Once you have feet, you can attach a torso, then a hand.  The order is important!
Think of the data import as building relationships between the objects, starting at the bottom with the "base" object and working your way up the body.  Accounts = feet.  Contacts = torso.  Opportunities = hands. 

Time for a final analogy?  Think of a tree.  The leaves depend on the branches which depend on the trunk which depends on the roots.  Complicated? No.  Difficult to determine the precise dependencies?  Sometimes yes.











Comments

Popular posts from this blog

Process Automation Specialist Superbadge - 5

A project with Daddy: My favorite daily process! Making dinner for Mom! Tonight's challenge involves the creation of two processes.   Processes.  Have you guessed the theme of the photos that go along with the Trailhead - Process Automation Specialist Superbadge series?They are a few of my favorite day to day processes!  You, my amazing reader, get more than tips for a Salesforce Superbadge.  You also get personal insight into the life of a Trailhead Baby!  I hope that you feel inspired. Process Builder sketch Last night, I drew a rough sketch of my process: Was it pretty?  No. Did it help?  Yes! The sketch allowed me to organize all of the instructions into a reasonable order before I started clicking.  It also removed the approval steps from Process Builder and highlighted (with *'s) the prerequisite items to building my process. * Email Alerts I needed the Email Alerts set up before I could create either the process or ...

Service Cloud Specialist Superbadge - 1,2,3

A confession - I know next to nothing about service cloud.  While I was excited that a new superbadge was available, it made me a little nervous that I had to do all of the prerequisites and tackle new things like macros.  New things - new year - let's get started! (Right after I finish guitar practice) If you are also a service cloud novice, the Omni-Channel Basics is a crucial prerequisite even though it is not officially required. Challenge 1 App Appearance  This, like all superbadges, requires a careful read through the instructions prior to any clicking.  I found it helpful to take a separate notebook and write down the steps that I would need for each challenge step - for example -  My rough notes for challenge 1: Create 2 profiles  Tweak service Console 3 new items on utility bar Allow access for new profiles Create User  Beware - After editing the service console, you might have to edit the new profiles.  I found i...

Lightning Experience Specialist Superbadge - 8

The best present? Santa says that I am getting a little brother in April! Let's import some data!  It's simple to mass delete the records if there are inserted incorrectly - and you have me to help!  The goal with this post is to move beyond the "how" of data import and explain the "why."  The challenge makes more sense when you think about the relationships between the objects.  I'll explain more below. First: A confession I, the Trailhead Baby, am not a perfect Salesforce admin.  Even though I completed this entire Superbadge in 2017, I still messed up the data import badly enough that I had to mass delete all of my records and start over.   Quick tip: It may help to delete the existing data before you start the import.  This way, when you extract recordID's, you only extract the ID's of the records that you have already imported vs. the records that were already in the Trailhead Playground by default. You can use many da...