📢 Attention Salesforce Certified Trailblazers! Maintain your credentials and link your Trailhead and Webassessor accounts by April 19th. Learn more.

Use Data Loader to Export Data


The next hot rod in your collection is the Data Loader. This application allows you to bulk import or export data in a few simple steps. Featuring a more robust engine than import wizards, you can use it to insert, update, delete, export, or upsert Salesforce records for both standard and custom objects.

Extract Data with the Data Loader

In this step, you use the Data Loader for extracting data from Accounts so you can update it later. But because Data Loader is a client application, you must log in to it with your username and password. So before you can start your engine, it’s necessary to find your username in your Trailhead Playground, and change your password.

  1. From Setup, enter Users in the Quick Find box, then select Users.
  2. Check the box next to your name. (Make note of your username.)
  3. Click Reset Password(s), then OK.
  4. Check the inbox for the email address associated with your username, and click the link in the email. (If you don’t see the email, check your spam folder.)
  5. Enter a new password and confirm it.
  6. Click Change Password.

Now download and install the Data Loader (if required). Note that the exact steps vary depending on the browser you’re using. Here’s how to do it using Firefox.

  1. From Setup, enter Data Loader in the Quick Find box, then select Data Loader.
  2. Click Download the Data Loader (choose Windows or Mac).

Windows users:

  • Double-click ApexDataLoader.exe to execute it.
  • Click I agree to accept the terms in the license agreement.
  • Select your administrator rights level, then click Next.
  • On the Choose Components screen, make sure all components are checked, then click Next.
  • Accept the default folder location and click Install, then click Next when installation is complete.
  • Click Finish.

Mac users:

  • Click the downloaded .dmg file to execute it.
  • Drag the Data Loader icon into the Applications folder.
  • Double-click the Data Loader icon to launch.

Next, open Data Loader and log in to the correct org.

  1. Windows users:
    Search Windows and open Data Loader.
    Mac users:
    Search Applications and open Data Loader.
  2. Click Export.
    Data Loader Export Arrow Screenshot
  3. Select Password Authentication.
  4. Enter your username, password, use https://login.salesforce.com for the Salesforce Login URL, then click Log in.
  5. Once verified, click Next.

If you have issues logging into Data Loader, try the following fix to see if it resolves the issue. If you were able to login, you can skip this section.

Fix: Add a security token to the end of your password to log in to Data Loader.

  1. From within your Trailhead Playground environment, click your profile icon in the upper right hand corner of the screen and click Settings.
  2. In the menu on the left, click Reset My Security Token.
  3. Click the Reset My Security Token button.
      A screenshot showing the Reset My Security Token page, with an arrow pointing at the Reset Security Token button.
  4. A message box appears, telling you to check for an email sent to the email address tied to your Trailhead Playground account.
  5. Copy the case-sensitive Security Token from the email you received.
  6. Open up or go back to Data Loader.
  7. Click Export and select Password Authentication.
  8. Enter your username.
  9. Enter your password and then append or paste your security token to the end of your password.
  10. Enter https://login.salesforce.com in the Salesforce Login URL box and click Login.
    A screen shot showing the Data Loader Password Authentication login page.  It has an arrow pointing to the end of the typed password with the text Enter security token here.
  11. If you were able to login, continue to the next section. If you are still unable to login, please access this Salesforce Help page to try another method to resolve the issue.

The next step is to select the Account object, rename the file to be extracted and save it to your desktop. Note: All file names default to extract.csv. Renaming files prevents losing or overwriting them.

  1. From the Select Salesforce Object list, select Account (Account).
  2. In the Choose a target for extraction text box, enter Accounts Export.csv.
  3. Click Browse…
  4. Navigate to the desktop, click Save, then click Next.

Now create the necessary SOQL query.

  1. Choose the query fields below:
    • Id
    • Name
    • Site
  2. To complete the where clause to your query, type (or copy and paste) WHERE Type LIKE '%Customer%' in the text box so your query looks like this:
    • Select Id, Name, Site FROM Account WHERE Type LIKE '%Customer%' Formula Screenshot
  3. Click Finish, then click Yes. The Operation Finished window appears, reporting the number of successful extractions. Note: The resulting export file should contain 11 records.

Next, export the extracted records to a CSV file and view it in Excel.

  1. Click View Extraction.
  2. In the CSV Viewer, if you are using Windows, click Open in external program. The file opens automatically in Excel. (Note: Mac version does not have this button. See Mac instructions below.)
  3. Leave the Data Loader open while viewing the file.
  4. Sort the account name column A-Z and save the file.

Windows users:

  • In Excel, click B to select the NAME column.
  • Click the Sort (or Sort & Filter) button in the upper right of the Excel Home tab, to sort this column A-Z. If you see a Sort Warning, select Expand the selection, then click Sort.
  • Under the File menu, click Save, and click OK on any messages that pop up.

Mac users:

  • Locate the CSV file you have just created, then open it by double-clicking.
  • Click Sort & Filter in upper right of screen and sort the Name column A to Z.
  • Under the File menu, click Save… then click the Save button. Keep the file open—you use it in the step.

You’ve zipped through import and export, but you still have some distance to cover. Cruise on to the next step, and use the Data Loader to update the data you’ve just extracted.