Sub topic 4
Importing with the Data Import Wizard
This chapter assumes you know what Salesforce objects, records, and fields are. It also assumes you can edit a CSV file and have permission to create records on the target object. A sandbox or Developer Edition org is a safe place to practice.
The Data Import Wizard is a browser-based tool in Setup. It suits small, simple jobs. It handles standard objects such as accounts, contacts, leads, and campaign members, and also custom objects. A single run accepts up to 50,000 records.
What the wizard does
You pick an object, choose an action, upload a CSV file, map columns to fields, and start the import. Salesforce then processes the file in the background and emails you when it finishes.
Step-by-step walkthrough
Use the Account file below. It has a header row and one record per line.
Name,Phone,Industry,Website
Acme Corp,555-0100,Manufacturing,https://www.acme.example
Globex Ltd,555-0101,Technology,https://www.globex.example- In Setup, enter Data Import Wizard in Quick Find and open the page. Click Launch Wizard.
- On the Standard Objects tab, select Accounts and Contacts. (Custom objects have their own tab.)
- Select Add new records.
- Leave the matching and assignment options at their defaults for a first run. Matching is covered in the next chapter.
- Drag your CSV file onto the upload area, or click to browse for it. Confirm the character encoding. UTF-8 is the usual choice.
- Click Next to reach the mapping screen.
- Review each mapping. Then click Next, check the summary, and click Start Import.
The wizard offers three actions: add new records, update existing records, or add and update together. This chapter uses add. Updates depend on matching, which the next chapter explains.
Mapping fields
The wizard tries to match each CSV header to a field by name. Headers that match, such as Phone, are mapped automatically. Unmapped columns are shown with a Map link beside them.
To fix a mapping, click Map next to the field. Then choose the CSV column that holds its data. Check these points before you continue:
- Every required field must be mapped. For accounts, that is
Name. - Columns you do not want to import can stay unmapped. Salesforce ignores them.
- A mapped column must contain values that fit the field type, for example valid picklist values and dates in a supported format.
The wizard maps one CSV column to one field. It cannot combine two columns or change values on the way in. Clean those in the spreadsheet first.
Checking the results
Click Bulk Data Load Jobs in Setup to see the job. The page shows how many records were processed and how many failed. For a failed job, the wizard lets you download an error file. Each failed row has the reason for the failure.
Open the error file, fix the cause, and import only the corrected rows. Do not re-import the whole original file, because that creates duplicates of rows that already succeeded.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Required field missing | A required field is unmapped or blank in the row | Map the column and fill in the blank values |
| Invalid picklist value | The CSV text does not match an active picklist value | Correct the text or add the value to the picklist |
| Date or number not recognised | Format differs from your user locale | Reformat the column to match your locale |
| Row rejected by validation | A validation rule fired | Correct the data to satisfy the rule |
| Duplicate records appear | The matching option was not set or the key differed | Review matching before the next run |
Exercise
You import 200 rows with the wizard. Twelve fail with errors. What is the safest way to load the failed rows?
Show answer
Download the error file, correct the cause of each failure, and import only those twelve corrected rows. Re-importing all 200 rows would create duplicates of the 188 that already succeeded.
Exercise
A CSV has columns FirstName and LastName, and you want a single Name field filled with both. Can the wizard combine them?
Show answer
No. The wizard maps one column to one field and cannot combine or transform values. Create the combined column in the spreadsheet before you upload.