Newer Version Available

This content describes an older version of this product. View Latest

Inserting, Updating, or Deleting Data Using Data Loader

Available in: Enterprise, Performance, Unlimited, Developer, and Database.com 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

The insert, update, upsert, delete, and hard delete wizards in Data Loader allow you to add new records, modify existing records, or delete existing records. Note that “upsert” is a combination of inserting and updating. 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, then the record is created as new. When you hard delete records, the deleted records are not stored in the Recycle Bin and become immediately eligible for deletion. For more information, see Configuring Data Loader.

  1. Start Data Loader by choosing Start | Programs | Salesforce | Data Loader | Data Loader.
  2. Click Insert, Update, Upsert, Delete or Hard Delete. These commands can also be found in the File menu.
  3. Enter your Salesforce username and password. Click Log in to log in. After your login completes successfully, 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 must 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.

  4. Choose an object. For example, if you are inserting Account records, select Account. If your object name does not display in the default list, check Show all objects to see a complete list of the objects that you can access. The objects are listed by localized label name, with developer name noted in parentheses. For object descriptions, see the Object Reference for Salesforce and Force.com .
  5. Click Browse... to select your CSV file. For example, if you are inserting Account records, you could specify a CSV file named insertaccounts.csv containing a Name column for the names of the new accounts.
  6. Click Next. After the object and CSV file are initialized, click OK.
  7. If you are performing an upsert:
    1. Your CSV file must contain a column of ID values for matching against existing records. The column may be either an external ID (a custom field with the “External ID” attribute), or Id (the Salesforce record ID). From the drop-down list, select which field to use for matching. If the object has no external ID fields, Id is automatically used. Click Next to continue.
    2. 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 drop-down list. If you make no selection here, you can use the related object's Id field for matching by mapping it in the next step. Click Next to continue.
  8. Define how the columns in your CSV file map to Salesforce fields. Click Choose an Existing Map to select an existing field mapping, or click Create or Edit a Map to create a new map or modify an existing map. For more details and an example of usage, see Defining Field Mappings.
  9. Click Next.
  10. For every operation, the Data Loader generates two unique CSV log files; one file name starts with “success,” while the other starts with “error.” Click Browse... to specify a directory for these files.
  11. Click Finish to perform the operation, and then click Yes to confirm.
  12. As the operation proceeds, a progress information window reports the status of the data movement.
  13. After the operation completes, a confirmation window summarizes your results. Click View Successes to view your success file, click View Errors to open your errors file, or click OK to close. For more information, see Reviewing Output Files.
  • If you are updating or deleting large amounts of data, review Performing Mass Updates and Performing Mass Deletes for tips and best practices.
  • There is a five-minute limit to process 100 records when the Bulk API is enabled. Also, if it takes longer than 10 minutes to process a file, the Bulk API places the remainder of the file back in the queue for later processing. If the Bulk API continues to exceed the 10-minute limit on subsequent attempts, the file is placed back in the queue and reprocessed up to 10 times before the operation is permanently marked as failed. Even if the processing failed, some records could have completed successfully, so you must check the results. If you get a timeout error when loading a file, split your file into smaller files, and try again.

Tip