Sub topic 10
Reading success and error files
This chapter assumes you can run an insert or update in Data Loader and that you know what a Salesforce record ID is. It covers the two result files Data Loader writes after each operation, and how to fix failed rows and rerun them.
What Data Loader writes
When an operation finishes, Data Loader asks for a folder and creates two CSV files in it. Their names include a timestamp, for example success20261130114135.csv and error20261130114135.csv.
- The success file lists every row Salesforce accepted.
- The error file lists every row Salesforce rejected.
Every row in your input file ends up in exactly one of the two files. If the row counts do not add up, check the batch for unprocessed rows before you assume anything was lost.
Both files repeat your original columns. Data Loader adds columns to the end of each row.
| File | Added column | Meaning |
|---|---|---|
| Success | `ID` | The ID of the record that was created or changed |
| Success | `STATUS` | The result, such as `Item Created` or `Item Updated` |
| Error | `ERROR` | The reason Salesforce rejected the row |
For an upsert, the STATUS value tells you whether the row created a new record or updated an existing one. For a delete, it shows Item Deleted.
Using the success file
The success file is the only place that links your source rows to the new Salesforce IDs. Keep it. You will need it in three cases:
- You loaded parent records and now need their IDs to load child records.
- You need to undo the load. Delete the IDs listed in the success file.
- You need to confirm that the number of loaded rows matches what you expected.
A sample success file after inserting Accounts looks like this:
"Name","Phone","Industry","Website","ID","STATUS"
"Acme Corp","555-0100","Manufacturing","https://www.acme.example","001XXXXXXXXXXXXXXX","Item Created"
"Globex Ltd","555-0101","Technology","https://www.globex.example","001YYYYYYYYYYYYYYY","Item Created"The IDs here are placeholders. Real files contain 18-character IDs.
Using the error file
Each error row keeps your original values and adds an ERROR message. The message usually names the problem and often the field. Common messages and their fixes:
| Message (shortened) | Likely cause | Fix |
|---|---|---|
| `REQUIRED_FIELD_MISSING` | A required field is blank | Fill in the value in the CSV |
| `INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST` | The value is not in a restricted picklist | Use an exact, existing picklist value |
| `STRING_TOO_LONG` | Text exceeds the field length | Shorten the value |
| `INVALID_CROSS_REFERENCE_KEY` | A lookup ID does not exist or is the wrong type | Check the related record's ID |
| `DUPLICATE_VALUE` | A unique or external ID value already exists | Remove the duplicate or use upsert |
| `FIELD_CUSTOM_VALIDATION_EXCEPTION` | A validation rule blocked the row | Change the data to satisfy the rule |
Errors in the same file often share one cause. Sort or filter the ERROR column in a spreadsheet and fix each group at once.
Fixing and rerunning failed rows
- Open the error file in a spreadsheet or text editor.
- Correct the data in the original columns.
- Delete the
ERRORcolumn. Data Loader will not map it to a field, and leaving it in only adds noise. - Save the file as CSV.
- Run the same operation again, using the corrected error file as the input.
Rerunning only the failed rows avoids creating duplicates of rows that already succeeded. Do not rerun the whole original file for an insert.
For update files, the Id column is kept in the error file, so the corrected file can be reused directly. Use the export query from your backup if you need to compare current values:
SELECT Id, Name, Phone, Industry FROM Account WHERE Industry = 'Energy'Partial success
Salesforce does not always roll back a whole load when some rows fail. Data Loader sends rows in batches, and rows are accepted or rejected individually in the default setup. A load can therefore finish with some records created and others not. Always open both files before you declare a load finished.
Exercise
You insert 500 Contacts and get 480 rows in the success file and 20 in the error file. Most errors read INVALID_CROSS_REFERENCE_KEY. What do you do next, and why not rerun the original file?
Show answer
Check the AccountId (or other lookup) values in the error rows against real record IDs, correct them, remove the ERROR column, and run the insert again using only the corrected error file. Rerunning the original 500-row file would create duplicate copies of the 480 Contacts that already loaded.