[SalesForce] Upserting Data using Data Loader with External ID

I'm using Data Loader in order to Upsert some data within my Org.

I know, that if I will Upsert a record within my CSV that has duplicate External Id value with another record in the file, It will throw me a duplicate error and the record will not be upload.

But i'm not sure – Dose Data loader will not upload the duplicated records at all?

Or it will upload the first record seeing on the CSV file, and then when he hits the other one it will throw a duplicate exception?

Best Answer

I will put 2 scenarios over here. I have created following csv file to upload data into my org, where

External Site Id is External Id (unique is not selected)

External Site key is External Id and also unique

Dataload_ExternalId

Scenario 1:

By default, Batch size of dataloader is "200"

So, if we perform upsert based on External Site Id or External Site Key, then in both the cases, Salesforce will try to process both the records in single batch and it will throw the error "Duplicate External Ids"

Scenario 2:

Change batch size to "1"

Perform upsert based on External Site Id or External Site Key, then in both the cases, Salesforce will try to process both the records in two different batches and successfully uploads the data.

2 things to be noted here:

  1. You will NOT receive any errors during upload. both of the records will be processed.

  2. Most importantly, Salesforce will update data with latest record that has been updated. So, in SFDC we will find single record (here the last record) with External Site Id

Related Topic