Newer Version Available
Insert, Update, or Delete Data Using Data Loader
Use the Data Loader wizards to add, modify, or delete records. The upsert wizard
combines inserting and updating a record. If a record in your file matches an existing record,
the existing record is updated with the values in your file. If no match is found, a new record
is created. When you hard-delete records, the deleted records are not stored in the Recycle Bin
and are eligible for deletion. For more information, see Configure Data Loader.
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer editions |
| User Permissions Needed | |
|---|---|
| To insert records: | Create on the record |
| To update records: | Edit on the record |
| To upsert records: | Create or Edit on the record |
| To delete records: | Delete on the record |
| To hard delete records: | Delete on the record |
| To mass delete records: | Modify All Data |
- To start Data Loader, double click the Data Loader icon on your Desktop or in your Applications folder.
- Click Insert, Update, Upsert, Delete, or Hard Delete. These commands are also listed in the File menu.
- Enter your Salesforce username and password. To log in, click Log
in. When you are logged in, click Next. (Until you log
out or close the program, you are not asked to log in again.)
If your organization restricts IP addresses, logins from untrusted IPs are blocked until they’re activated. Salesforce automatically sends you an activation email that you can use to log in. The email contains a security token that you add to the end of your password. For example, if your password is mypassword, and your security token is XXXXXXXXXX, you must enter mypasswordXXXXXXXXXX to log in.
- Choose an object. For example, if you are inserting Account records, select Account. If your object name does not display in the default list, select Show all objects to see a complete list of the objects that you can access. The objects are listed by localized label name, with the developer name noted in parentheses.
- To select your CSV file, click Browse. For example, if you are inserting Account records, you could specify a CSV file called insertaccounts.csv containing a Name column for the names of the new accounts.
- Click Next. After the object and CSV file are initialized, click OK.
- If you are performing an upsert, your CSV file must contain a column of ID values for
matching against existing records. The column is either an external ID (a custom field with
the External ID attribute) or ID (the Salesforce record ID).
- From the dropdown list, select which field to use for matching. If the object has no external ID fields, ID is used. Click Next to continue.
- If your file includes the external IDs of an object that has a relationship to your chosen object, enable that external ID for record matching by selecting its name from the dropdown list. If you make no selection, you can use the related object’s ID field for matching by mapping it in the next step. Click Next to continue.
- Define how the columns in your CSV file map to Salesforce fields. To select an existing field mapping, click Choose an Existing Map. To create or modify a map, click Create or Edit a Map. Click Next.
- For each operation, the Data Loader generates two unique CSV log files. One file name starts with “success,” and the other starts with “error.” Click Browse to specify a directory for these files.
- To complete the operation, click Finish, and then click Yes to confirm. As the operation proceeds, a progress information window reports the status of the data movement.
- To view your success or error files, click View Successes or View Errors. To close the wizard, click OK .