CSV usage in Salesforce is mostly about getting data in or out correctly. The format itself is simple; the rules around quoting, encoding, and field mapping cause most of the problems.
- Save your source file as UTF-8 CSV
From Excel, File, Save As, CSV UTF-8. From Google Sheets, File, Download, CSV. Verify the encoding before upload.
- Match column headers to Salesforce field API names
Data Loader maps by column header; use the exact API name (Account__c, MyCustomField__c) to avoid manual mapping. Standard fields use the API name (Name, Email, Phone), not the label.
- Quote fields containing commas, newlines, or double quotes
A field like Acme, Inc must be wrapped in double quotes. A field with an embedded double quote, like 5 inches, must double the inner quote. Validate by re-opening the CSV in a text editor.
- Verify field types match
Date fields require yyyy-MM-dd format; Datetime requires yyyy-MM-ddTHH:mm:ssZ. Boolean accepts 1/0 or TRUE/FALSE. Phone fields accept any format Salesforce can parse. Test with a small batch first.
- Use external IDs for upsert
For repeatable imports (nightly sync of customer data), add an external ID column and use upsert in Data Loader. Salesforce matches existing records by the external ID and updates them; new IDs create new records.
- Validate the output of imports
After Data Loader runs, check the Success and Error CSV files it writes. The Error CSV shows which rows failed and why. Fix and re-import the errors.
- Excel often saves CSV as Windows-1252 by default. Non-ASCII characters corrupt on import. Use the CSV UTF-8 export option explicitly.
- Trailing empty rows in Excel exports can fail Data Loader jobs. Open the CSV in a text editor and remove empty trailing lines.
- BOM (Byte Order Mark) at the start of UTF-8 files breaks some Salesforce tools. Remove with a text editor or a tool like dos2unix if needed.
- Date formats vary by locale. Excel in the US writes M/d/yyyy; Salesforce expects yyyy-MM-dd. Convert before import or set the locale explicitly in Data Loader.
- Commas inside quoted fields are tolerated; newlines inside quoted fields work in modern parsers but not all of them. Test with the specific tool you are using.