Loading

Data Loader Update or Upsert Fails with "Duplicate Id Specified" Error or Returns Unexpected Values When CSV Contains Duplicate Record IDs

Publiseringsdato: Jun 3, 2026
Beskrivelse

When a CSV file contains multiple rows that reference the same Salesforce record ID in the ID column, performing an Update or Upsert operation using Data Loader may result in one of the following outcomes:

  • The operation fails with the error: 'Duplicate Id Specified'
  • The record in Salesforce is updated, but the final values do not match what is expected based on the CSV file content

Data Loader is a Salesforce client application used for bulk data operations. When performing an Update or Upsert, each row in the CSV file is treated as an individual instruction to modify a specific Salesforce record, identified by its ID. If the same record ID appears more than once in the file, this creates duplicate processing instructions.

 

Løsning

This article explains what causes the "Duplicate Id Specified" error in Data Loader and how to prevent unexpected update behavior when your CSV file contains duplicate record IDs.


Why This Happens
Rows in a CSV file that share the same record ID in the ID column are treated as duplicate entries by Data Loader. The behavior depends on whether those duplicate rows are processed in the same batch or in different batches:

 

  • Same batch: If two rows with the same record ID are included in the same processing batch, the operation fails immediately with the error Duplicate Id Specified and identifies the duplicate ID. For example: Error: Duplicate id specified: 0013000000auCyTAAU — where 0013000000auCyTAAU is the ID that appears in multiple rows within the same batch.
  • Different batches: If the duplicate rows fall into separate batches (due to batch size configuration), Data Loader processes each row independently. The record is updated with the values from the first occurrence in the first batch, and then updated again with the values from the second occurrence in the second batch. The final state of the record reflects the last batch processed.

Example of Cross-Batch Duplicate Behavior

  1. Set Batch Size to 50 in Configure Data Loader.
  2. Create a CSV file containing two rows with the same Salesforce record ID — the first occurrence in row 1 and the second occurrence in row 51.
  3. Perform an Update or Upsert operation.

Result: The record is updated with the values from row 1 in the first batch, and then overwritten with the values from row 51 in the second batch. The final record reflects the values from row 51.


Recommended Prevention Steps
Before performing any Update or Upsert operation, review your CSV file to identify and remove any duplicate rows. As a best practice, validate your CSV for duplicate IDs before running any bulk data operation to avoid unintended record modifications.

Knowledge-artikkelnummer

000384876

 
Laster
Salesforce Help | Article