Exporting data through Data Export
For the next imports, we will be needing the Salesforce record IDs of the newly created Person and Company objects. To get those IDs, we'll need to export that data. Let's do that using the built-in Data Export functionality:
- Navigate to Setup | Data Export and click on Export Now. Leave the defaults on top of the page, and select our two custom objects, Person__c and Company__c. The custom objects are at the bottom of the page:
- After selecting the objects you want to export, hit Start Export!. You'll get the following confirmation screen, telling you that the export is now scheduled and that you will be receiving an email when the data is ready:
- The email will look like this, so just click on the link to download the export file(s):
- Click the download link below the Action field. This will download a .zip file, containing a .csv file for each object, containing its records. Save the .zip file in any folder you would like or on your desktop. When you open it, it should look like the following:
- Let's look at the contents of the Person__c file. This file contains all fields that currently exist for the Person__c object to which you have access, including system fields such as CreatedDate and CreatedBy. The most important column is the first column, called Id. This is the Salesforce record ID for each record, and, in the next sections when we need to create any relationship between records, we will need to fill the lookup fields with the ID of the record we want to associate:
Remember, for example, our The Godfather movie, which has a lookup field called Director, which is a relationship to a Person record that corresponds to that director, right? So, when we load our movies, we will need to populate the Director field with the ID of the Person record that corresponds to Francis Ford Coppola, highlighted in green in the following screenshot:
This means that, for the next imports, we will first have to do some Excel magic by performing VLOOKUP functions to populate the lookup columns with their correct corresponding record IDs from those export files. Don't worry, we'll go through it step by step.
So, that's one way to load data into Salesforce by using the Data Import Wizard, and one way to export data from Salesforce by using the Data Export functionality.