Loading

Error 'Duplicate Id Specified' or CSV with duplicate records on update or upsert

Дата публикации: Oct 13, 2022
Описание


If your CSV file contains multiple rows that reference the same record ID in the ID column, any attempt to use Data Loader and perform an update or upsert may result in unexpected behavior. 

 
  • The operation may result in an error: 'Duplicate Id Specified'
  • Or the updated record values may not match the values in the CSV file.
Решение

If multiple rows in the CSV file contain the same record ID in the ID column, those rows are considered to be duplicates. As a best practice, we recommend that you review your CSV file prior to update to remove any duplicate rows.


If the Upsert or Update operation attempts to process duplicate entries in your CSV file within the same batch of records, the operation will fail with 'Duplicate Id Specified' and specify the duplicate Id.


Error: Duplicate id specified: 0013000000auCyTAAU

Where 0013000000auCyTAAU is the Id that's contained in multiple rows within your CSV.

 

However, if the duplicate rows are processed as a part of separate or different batches, the corresponding record in Salesforce is updated with the values each row, and will reflect the values in the last rows when the update has completed.
 

Example:
 

  • Set Batch Size as outlined in Configure Data Loader to a value of 50.
  • Create a CSV containing two rows with duplicate Salesforce record Ids with the first occurrence in row 1 of the file and the second occurrence of the Id in row 51.  
  • Perform an Update or Upsert
 
Result: The corresponding record in Salesforce will be updated  with the values set by row 1 in the first batch, but will subsequently be updated with the values in row 51 in the second batch. 
Номер статьи базы знаний

000384876

 
Загрузка
Salesforce Help | Article