Sub topic 6
Installing Data Loader and logging in
Data Loader is a desktop application that moves records between CSV files and Salesforce through the Salesforce APIs. Unlike the Data Import Wizard, it is not part of the browser UI. You download it, install it on your computer, and sign in from inside the application.
This chapter covers system requirements, installation, the two login methods, and the first settings to check. It also covers the login errors you are most likely to see.
Prerequisites
This chapter assumes the following:
- You know what Salesforce objects, records, and fields are.
- You can open a terminal or command prompt and run a simple command.
- You have a Salesforce org to practice in. A sandbox or Developer Edition org is best.
- You have decided Data Loader is the right tool for your job. The previous chapters on tool selection cover that decision.
What you need before you install
Four things must be in place before Data Loader will connect.
- A supported computer. Salesforce provides installers for Windows and macOS. Linux is not an officially supported platform for the graphical application.
- A Java runtime. Data Loader is a Java application. Recent versions require a current long-term-support Java release (Java 17 at the time of writing), so check the system requirements on the download page for your version. Older Java versions fail with startup errors.
- API access in your org. Data Loader talks to Salesforce through the API. Enterprise, Unlimited, Performance, and Developer Edition orgs include API access. Professional Edition needs it added separately.
- A user with the right permissions. The user must have the API Enabled permission, plus object and field permissions for the data being loaded. A user who can create Accounts in the UI but lacks API Enabled cannot log in to Data Loader.
Check your Java version from a terminal:
java -versionIf the command is not found, or the version is older than the one the download page requires, install a supported JDK first. Then open a new terminal and run the command again.
Downloading the installer
Salesforce hosts the installer inside your org, so you always get a build that matches the platform.
- Log in to Salesforce and open Setup.
- In Quick Find, type
Data Loader. - Select Data Loader under Integrations.
- Download the package for your operating system.
You can also download it from the Salesforce developer site. Either way, use the official Salesforce source. Do not use third-party mirrors, because Data Loader handles your credentials and your data.
Installing on Windows and macOS
The installer is a compressed archive. Unzip it into a folder you can keep, because the install step records that location.
On Windows, open a terminal in the unzipped folder and run the install script:
.\install.batOn macOS, run the equivalent script from the unzipped folder:
./install.commandThe script asks where to put the application and whether to create a desktop shortcut and a Start menu or Applications entry. Accept the defaults unless you have a reason to change them. On macOS, the operating system may block the script the first time because it was downloaded. Allow it from the security prompt in System Settings and run it again.
After installation, start Data Loader from the shortcut. The first screen is the Welcome dialog. It lists the seven actions you can perform:
| Action | What it does |
|---|---|
| Insert | Creates new records from CSV rows |
| Update | Changes existing records that you identify by Id |
| Upsert | Updates records that match an ID or external ID, and inserts the rest |
| Delete | Moves records to the Recycle Bin |
| Hard Delete | Permanently deletes records, bypassing the Recycle Bin |
| Export | Writes query results to CSV |
| Export All | Same as Export, but includes deleted and archived records |
The next chapter covers each operation in detail. At this point you only need to know that you must log in before you can use any of them.
Choosing a login method
Data Loader offers two ways to authenticate.
- OAuth. Data Loader opens your browser, you sign in on a real Salesforce login page, and you approve access. Data Loader receives a token and never sees your password. This is the default and the recommended method.
- Password authentication. You type your username, and your password with a security token appended, directly into Data Loader. This method exists for older setups and for environments where a browser cannot be launched. Organizations can restrict or disable it.
OAuth is the better choice for two reasons. It works with single sign-on and multi-factor authentication, and it keeps your password out of the application.
Logging in with OAuth
- Start Data Loader and click Log in with OAuth. If the dialog asks for an environment, choose Production for a production or Developer Edition org, or Sandbox for a sandbox.
- Your default browser opens a Salesforce login page. Sign in with your normal credentials, including any multi-factor prompt.
- Salesforce shows a consent screen for the Data Loader connected app. Click Allow.
- The browser shows a confirmation message. Return to Data Loader, which now displays the Welcome screen.
If the environment is wrong, the login fails with an invalid credentials message. A sandbox username has the sandbox name appended, such as [email protected]. That username does not exist on the production login server. The same username with the wrong environment is the most common cause of a failed first login.
If your org uses a My Domain URL, you can set the server host in Settings so the login goes to your domain instead of the generic login server. Your administrator can tell you which URL to use.
Logging in with a username and password
If your organization still allows password authentication, choose that method on the login dialog. You will then enter three things:
- Username: your full Salesforce username, which looks like an email address.
- Password: your password, with the security token added to the end if one is required. For example, if the password is
MyPass1and the token isAb12Cd34, enterMyPass1Ab12Cd34. - Server host:
https://login.salesforce.comfor production, orhttps://test.salesforce.comfor a sandbox. You set this under Settings.
A security token is required when you log in from an IP address outside your org's trusted IP ranges. You can reset it from your personal settings by choosing Reset My Security Token. Salesforce emails the new token to you. Resetting a token invalidates the old one, so any other integration that used it will stop working.
Settings to check after you log in
Open Settings from the Data Loader menu. Many options exist, and a later chapter covers performance tuning. For a first session, check only these:
| Setting | What to check |
|---|---|
| Server host | Matches your org type: production, sandbox, or My Domain |
| Batch size | The default is fine for a first test |
| Use Bulk API | Leave off for small tests, and consider it for large volumes |
| Insert null values | Leave off unless you want blank CSV cells to clear existing values |
| Timeout and compression | Keep the defaults unless the network is slow |
Insert null values deserves attention now, because it affects updates. When it is off, an empty cell in your CSV leaves the field unchanged. When it is on, an empty cell erases the value in Salesforce.
Common login errors
| Message or symptom | Likely cause | Fix |
|---|---|---|
| Invalid username, password, security token; or user locked out | Wrong environment, wrong password, or missing token | Check production versus sandbox, then confirm the username format and token |
| API is not enabled for this user | The profile or permission set lacks **API Enabled** | Ask an administrator to grant it |
| API access not available in this org | The edition does not include API access | Use a Developer Edition or sandbox org, or ask about an API add-on |
| Browser opens but Data Loader never finishes login | A browser or firewall blocked the local callback | Retry with a different default browser, and check security software |
| Application will not start or shows a Java error | Missing or unsupported Java version | Install a supported JDK and run `java -version` to confirm |
| Login works, but the object is not listed later | Missing object permissions | Check the profile or permission set for that object |
When a login fails, read the full message. Salesforce error codes such as INVALID_LOGIN or API_DISABLED_FOR_ORG point to a specific cause and make searching or asking an administrator much faster.
Logging out and switching orgs
Data Loader keeps one session at a time. To work in another org, for example to rehearse in a sandbox and then run the job in production, close the current session and log in again with the other environment selected. Always confirm the org name or username on screen before you run a delete or update. Running a job against the wrong org is the most expensive mistake this tool allows.
Exercise
A colleague tries to log in to Data Loader with the username [email protected] and the correct password, but selects Production. The login fails with an invalid credentials message. What is the likely cause and the fix?
Show answer
The username belongs to a sandbox, as the .dev1 suffix shows, but Data Loader is sending the login to the production login server. Choose the Sandbox environment (test.salesforce.com, or the sandbox's My Domain URL) and log in again. If password authentication is in use, also confirm that the security token is appended to the password.
Exercise
Name two prerequisites outside Data Loader itself that must be satisfied before a user can log in, and say why OAuth is preferred over password authentication.
Show answer
The user needs a supported Java runtime on the computer, and the user needs the API Enabled permission in an org whose edition includes API access. OAuth is preferred because the password is entered only on the Salesforce login page, never in Data Loader, and it works with single sign-on and multi-factor authentication.