Import CSV to Salesforce (Step-by-Step Guide)
Learn how to import CSV data into Salesforce using Data Import Wizard and Data Loader. Tips for mapping fields, handling IDs, and avoiding errors.
Import CSV to Salesforce (Step-by-Step Guide)
Getting data into Salesforce is a daily task for admins. Whether you are migrating from a legacy CRM, uploading a trade show list, or updating records, the CSV import is your best friend.
But Salesforce is picky. One wrong header or ID format, and your import fails.
Here is the definitive guide to importing CSVs into Salesforce without the headaches.
Method 1: Data Import Wizard (Best for < 50k Records)
This is the built-in tool accessible right from your browser.
Best for:
- Simple imports (Leads, Accounts, Contacts, Custom Objects).
- Files under 50,000 records.
- Preventing duplicates (it has basic matching logic).
Steps:
-
Clean Your CSV:
- Ensure headers match Salesforce field names (e.g., "First Name", "Email").
- Check required fields (Last Name, Company for Leads).
- Format dates as
YYYY-MM-DD.
-
Go to Setup:
- Click the Gear icon > Setup.
- In Quick Find, type "Import Wizard".
- Click Data Import Wizard.
-
Launch Wizard:
- Click Launch Wizard.
- Choose your object (e.g., Leads).
- Choose action: Add new records, Update existing, or Add new and update existing.
-
Upload CSV:
- Drag and drop your file.
- Leave "Match by" settings as default unless you are updating records (then match by Email or ID).
-
Map Fields:
- Salesforce tries to auto-map columns.
- Review the mapping. If a column is "Unmapped", click Map and select the correct Salesforce field.
- Tip: If you have a column you don't need, leave it unmapped.
-
Start Import:
- Click Next > Start Import.
- You'll get an email when it's done.
Method 2: Data Loader (Best for > 50k Records)
For heavy lifting, use the desktop Data Loader application.
Best for:
- Large files (up to 5 million records).
- Objects not supported by the Wizard (e.g., Opportunities, Products).
- Automated/scheduled imports.
Steps:
-
Install Data Loader:
- Download from Salesforce Setup > Data Loader.
-
Login:
- Open Data Loader.
- Click Insert (to create) or Update (to modify).
- Log in with OAuth (Salesforce credentials).
-
Select Object & CSV:
- Choose the object (e.g., Opportunity).
- Browse for your CSV file.
-
Mapping:
- Click Create or Edit a Map.
- Click Auto-Match Fields to Columns.
- Drag and drop fields to fix any mistakes.
- Click OK > Next.
-
Finish:
- Choose a directory for success/error logs.
- Click Finish.
Common Import Errors & Fixes
1. "Invalid Date"
Error: Salesforce rejects 12/31/2024.
Fix: Format dates in your CSV as YYYY-MM-DD (e.g., 2024-12-31) or YYYY-MM-DDThh:mm:ssZ for date/time.
2. "Required Field Missing"
Error: You forgot "Last Name" or "Company" on a Lead. Fix: Filter your CSV for empty cells in required columns and fill them in.
3. "Bad Value for Restricted Picklist"
Error: You tried to import "USA" but the picklist only accepts "United States". Fix:
- Standardize your CSV to match the picklist values exactly.
- Or, temporarily disable "Restrict picklist to the values defined in the value set" in Salesforce field settings.
4. "ID not found" (During Updates)
Error: You are trying to update records, but the Record ID is wrong (15-char vs 18-char). Fix: Always use the 18-character (case-insensitive) ID for imports to be safe.
Tips for Success
- Test First: Import 5 rows first to verify mapping.
- Backup: Export data before running a large Update/Delete.
- Use External IDs: If syncing with another system, create a custom "External ID" field in Salesforce. This lets you update records based on your system's ID, not Salesforce's ID.
Need to clean your data before Salesforce? HappyCSV can format dates, remove duplicates, and validate emails to ensure a 100% success rate on import.
Related Articles
Anonymize CSV Data (GDPR/Testing)
How to mask sensitive data in CSV files. Anonymize names, emails, and phones for testing or GDPR compliance.
Batch Convert Multiple Excel Files to CSV
How to convert 100 Excel files to CSV at once. Use VBA macros, Python scripts, or batch converters to save hours of manual work.
Best Free CSV Viewers for Mac & Windows
Excel isn't the only way to open CSVs. Check out the best free CSV viewers like Tad, Miller, and online tools for large files.
Need to handle CSV files?
HappyCSV is the free, secure way to merge, split, and clean your data — all in your browser.