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.
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.
- From Setup, enter
Usersin the Quick Find box, then select Users.
- Check the box next to your name. (Make note of your username.)
- Click Reset Password(s), then OK.
- 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.)
- Enter a new password and confirm it.
- 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.
- From Setup, enter
Data Loaderin the Quick Find box, then select Data Loader.
- Click Download the Data Loader (choose Windows or Mac).
Note: If you need assistance installing Data Loader, click Windows Installation Instructions or Mac Installation Instructions from Data Loader Setup to open the corresponding Salesforce Help article.
Next, open Data Loader and log in to the correct org.
- Windows users:
Search Windows and open Data Loader.
Search Applications and open Data Loader.
- Click Export.
- Select Password Authentication.
- Enter your username, password, use https://login.salesforce.com for the Salesforce Login URL, then click Log in.
- 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.
- From within your Trailhead Playground environment, click your profile icon in the upper right hand corner of the screen and click Settings.
- In the menu on the left, click Reset My Security Token.
- Click the Reset My Security Token button.
- A message box appears, telling you to check for an email sent to the email address tied to your Trailhead Playground account.
- Copy the case-sensitive Security Token from the email you received.
- Open up or go back to Data Loader.
- Click Export and select Password Authentication.
- Enter your username.
- Enter your password and then append or paste your security token to the end of your password.
- Enter https://login.salesforce.com in the Salesforce Login URL box and click Login.
- After you see "Login successful", click Next.
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.
- From the Select Salesforce Object list, select Account (Account).
- In the Choose a target for extraction text box, enter Accounts Export.csv.
- Click Browse…
- Navigate to the desktop, click Save, then click Next.
Now create the necessary SOQL query.
- Choose the query fields below:
- 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%'
- 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.
- Click View Extraction.
- 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.)
- Leave the Data Loader open while viewing the file.
- Sort the account name column A-Z and save the file.
- 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.
- 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.