Describe the considerations when importing, updating, transferring, and mass deleting data (e.g., CSV files, data quality, field mapping, record IDs, external IDs, duplicate records).
Salesforce data can be inserted, updated, upserted, and deleted with different data management tools. To modify Salesforce data, columns from a source file must be mapped to fields. For update and delete operations, a Salesforce record ID or external ID must be included in this field mapping.
Salesforce data can be modified with insert, update, upsert, and delete operations.
Insert operations are used to import new data into Salesforce. To import records into Salesforce, columns from a source CSV file must be mapped to an object and to fields on that object.
The update operation can be used to change values in existing Salesforce records. Apart from fields to be updated, a record ID or external ID must be mapped from the source file to Salesforce fields. This allows the update operation to identify records to be updated.
Upserts are a combination of insert and update operations. Data from the source file for which a matching record ID or external ID is found are updated, all others are inserted.
Salesforce data can be removed with delete operations. Based on a mapped record ID or external ID value, records are deleted and moved to the recycle bin for 15 days. After this period, the deleted data get permanently erased. With some data management tools, it is also possible to hard delete data and skip the recycle bin.
Salesforce uses CSV files for data management operations. Data columns in those CSV files must be mapped to Salesforce fields, to specify the source and destination data.
For update and delete operations, data from the source CSV file must be mapped to Salesforce records. A Salesforce record ID or a custom external ID can be used to link source and destination data.
Salesforce record IDs consist of 15 characters to uniquely identify records across Salesforce org. The same IDs can also be represented with 18 digits, by adding three checksum characters.
External IDs are record identifiers originating from external systems. Those fields can be used in data management operation as identifiers for updated and deletions. Custom fields can be specified as external ID by checking the External ID checkbox.
The External ID flag alone does not enforce values to be unique. Data management operations mapped to this external IDs would therefore impact all records with matching values. To prevent storing the same external ID in a custom field on multiple records, the Unique checkbox can be checked.
Up to 25 external ID fields can be created on a Salesforce object. Those fields must be of field type text, number, or email.
Salesforce provides several tools to manage data quality. Duplication management features allow to identify and merge duplicate records within Salesforce. Validation rules are enforced during data management operations by default and can help to avoid inconsistent data.
Salesforce provides duplicate management features, to identify and merge duplicate records for some standard and all custom objects.
Validation rules are also triggered during data operations such as insert, upsert, and delete. To prevent this, expectations can be added to skip validation rules for specific data management users.
Similarly to validation rules, also Apex triggers are executing when modifying data with data management tools. To prevent this, an exception can be added to Apex code, to skip triggers for specific data management users.
Instead of updating the owner field of Salesforce records with data management tools, the owner of Salesforce records can also be transferred from one to another user within Salesforce. The Salesforce Mass Transfer feature is available for many standard objects and custom objects.
Transferring owners using the Mass Transfer feature supports transferring related records.