Example in Upsert Key and Is Required for Upsert
assume that you have a custom Salesforce object called “Employee__c” with the following fields:
- Employee_Number__c (Text)
- First_Name__c (Text)
- Last_Name__c (Text)
- Email__c (Email)
Now, you have a CSV file with the following data:
Employee_Number__c | First_Name__c | Last_Name__c | Email__c |
---|---|---|---|
E001 | John | Smith | [email protected] |
E002 | Jane | Doe | [email protected] |
E003 | Robert | Johnson | [email protected] |
You want to use DataRaptor to upsert this data into Salesforce, where the Employee_Number__c field will act as the key field.
To do this, you would configure the following mapping options:
- Upsert Key: Enable this option for the Employee_Number__c field. This tells DataRaptor that the Employee_Number__c field will act as the key field for the upsert operation.
- Is Required for Upsert: Enable this option for the Email__c field. This tells DataRaptor that the Email__c field must have a non-null value for the upsert operation to be performed. This ensures that only those records with a valid email address will be updated or inserted.
So, when you run the upsert operation using DataRaptor, it will check each row in the CSV file and perform the following:
- If the Employee_Number__c value exists in Salesforce, it will update the corresponding record with the data from the CSV file.
- If the Employee_Number__c value doesn’t exist in Salesforce, it will insert a new record using the data from the CSV file.
- If the Email__c value is null for a particular row, DataRaptor will skip that row and move on to the next one.
By using Upsert Key and Is Required for Upsert settings, you can ensure that only the required data is updated in Salesforce and that the upsert operation is performed efficiently.
I hope this information is helpful for you.