Creating users in Salesforce is one of the most common tasks for a Salesforce Administrator. In many real-world scenarios, companies hire multiple employees at once, and creating users one by one becomes time-consuming and inefficient.
To solve this problem, Salesforce provides a powerful tool called Data Loader that allows admins to bulk insert multiple users from a CSV file.
I was working as a Salesforce admin. Recently, our organization hired 50 employees, and the hiring manager asked me to quickly create user accounts for all of them.
Instead of manually creating a single user record, we use a feature data loader in Salesforce to insert multiple user records at once.
Here, I will explain how to insert multiple users with a data loader in Salesforce. We will see what to do when we encounter duplicate usernames during user data insertion and explain how to find duplicate usernames already in our Salesforce org.
What is Data Loader in Salesforce?
Data Loader is a client application used to import, export, update, and delete large volumes of data in Salesforce. It supports operations like Insert, Update, Upsert, Delete, and Export, making it a powerful tool for data management.
For example, if your company collects thousands of leads or hires multiple employees, you can use Data Loader to upload all records at once instead of manually creating them one by one.
When it comes to user creation, Data Loader is especially useful because Salesforce requires multiple fields and configurations for each user, which can be easily handled through a structured CSV file.
Insert Multiple Users With Data Loader in Salesforce
Using the following steps, we can create multiple users at once using the Salesforce data loader.
To import users using a data loader in Salesforce, ensure you have system administrator access and that a data loader is installed on your system.
1. Create a CSV File to Store Employee Details
To import the users, we first need to create an external csv file with the header columns required for user creation. We can create this file in Excel and save it as a .csv file. For example, ‘NewUsers.csv‘.
Enter First Name, Last Name, Alias, UserName, and Email into the Excel sheet. Ensure that the email addresses and usernames of the two users are different.
They have to be unique. I entered the same username for two users to explain what would happen when we inserted this csv file through the data loader.
I explained the columns in the CSV file that are usually new to us in the list below.
- RoleID: Enter the ID of the Role that you want to assign to a particular user.
- ProfileID: Enter the ID of the profile that you want to assign to a particular user.
- LocaleSidKey: This determines the format of dates, times, numbers, and user names according to regional standards.
- LanguageLocaleKey: This field specifies the language in which Salesforce displays user interface elements such as labels, buttons, and error messages.
- EmailEncodingKey: This ensures that the characters in the email content are correctly encoded and displayed according to the recipient’s language and region.
- CurrencyIsoCode: This field represents the currency associated with a record when multi-currency is enabled in an organization.

2. How to Get a Profile ID in Salesforce?
To get the ProfileID, go to the setup window, search for Profiles in the Quick Find box, and click it.
In the Profiles setup, select the license name to which you have to add users (in this example, I have selected the Identity User license).
After opening the standard user edit window, copy the 15-digit ID from the URL that starts with 0.
Now, paste that profile ID in the ProfileID column and keep it the same for all users. After this, save this CSV file.

3. How to Get Role ID in Salesforce?
To get the UserRoleId, open the Quick Find box and search for Roles. Then, in the Roles setup, select a role you want to assign to the user. In this example, I have selected a custom Employee Role.
In the setup for the selected role, go to the URL and copy the 15-digit code starting with 0 at the end of the URL.
Then paste this role ID in the header column UserRoleId.

4. Insert Users with Data Loader in Salesforce
Open the Data Loader tool. For that, you need to install the data loader and log in with your credentials. Then, click on the Insert button.

1. In this window, activate the checkbox. Show all Salesforce Objects, and then select the option User (User) from the list of objects. Then click the Browse button to select the CSV file we created in the above steps.
Click on the Next button to proceed.

2. In this step, we will create a mapping between the external file’s column header and the Salesforce Object Field Name. To do so, click on the button Create or Edit a Map.
In the next window, click on the button Auto-Match Fields to Column. If any column is missing in mapping, you can search for the field and drag and drop it to the CSV file column.
After completing the mapping, click OK, then click Next.

3. Select a folder or location in your system to save the success and error files so they can be accessed later. Finally, click the Finish button.

4. To start inserting new records, click on the Yes button.

5. Error Records CSV File in Data Loader
Now, the import operation will start, and upon completion, we will receive a message with the import’s success and errors. If you don’t encounter any errors, click OK to close the data loader wizard.
Here, we have one error record. To view the error records and the error message, click the View Errors button.

As you click View Errors, you will see that we get one error with an already-existing username, which should be unique.
When we created a CVS file, I created two users with the same username, and we got only one username error.
This is because when you insert data with the data loader, the first record is always saved to the Salesforce database, and subsequent records return an error.
Here, I encountered only one error due to a duplicate username, so I was able to create a new user from the org.
However, when we encounter an error in multiple user records, we must modify the username column and then repeat the step to insert the user from the data loader.

6. View Inserted/Created Users with Data Loader in Salesforce
To view the imported users, go to the profiles setup and open the profile where you imported them.
In this example, I have imported the Identity user profile users with the Identity license.
You can see that we entered an identity profile ID, so all users are saved under the same identity profile. We also entered the employee role ID, and the Employee role is assigned to all new users.

In the image above, we can see that users have been created for the selected profile.
In this way, we can import and create users in Salesforce using the steps above.
How to Find Duplicate Username in Salesforce
When we insert the user multiple times using the data loader, we get an error message in the username field stating that the username already exists and must be unique.
For that, when we create the csv file to insert multiple users. Before inserting the user, we can check whether the username is already in use in the Salesforce org. Using the following steps, we can find duplicate usernames in Salesforce.
1. Open the Data Loader tool. In the data loader window, click on the Export button.

2. In this step, search for the User(User) object. After this, select the target file for data extraction; the CSV file will be saved with the name you enter in this field.
In this example, I have entered the target file name as Export Usernames.csv.
Then click the Next button to proceed.

3. In this step, select the query fields of the data you want to export. The query-chosen fields will be created as a header column in the CSV file. In this example, I have selected the Username field.
The query generated will generate a query for fetching the username records, and you can also add a condition that acts as a where clause in the query.
Here, I want to fetch all usernames so I don’t need to include a where clause. After selecting the fields, click on the Finish button.

4. In this warning window, click the Yes button to proceed with the data export.

5. After finishing the operation, we will get a message about the success and errors of the export operation. To view the extracted data in a CSV file, click View Extraction.

6. The extracted data will open in a CSV viewer when we click the View Extraction button. If you want to open this csv file in Excel, click the Open in external program button. It will open in an Excel sheet; you need to copy the username cell.

7. Now, paste the exported username cell in the csv file you created to insert the user with the data loader. Now, we need to compare both username fields, new and existing, to find equal values.
To view the duplicate values, create the Result column, select the first cell of the result column, and enter the formula in the formula editor.
=IF (COUNTIF ( $E$2 : $E$11, F2 ) > 0,"YES","NO")- $E$2 : $E$11 – This will select new username column values.
- F2 – Select the existing username column value.
This checks for duplicates between the username column and the exported username file column, returning a result indicating whether duplicates are present.

In this way, you can find duplicate new usernames with existing usernames already in your Salesforce org. This allows you to change the username before inserting the user record with the data loader in Salesforce.
Why Use Salesforce Data Loader Instead of Manual Creation?
| Feature | Manual | Data Loader |
|---|---|---|
| Time | Slow | Fast |
| Efficiency | Low | High |
| Bulk Handling | No | Yes |
| Error Tracking | Limited | Available |
Frequently Asked Questions
Q1: Can we create multiple users in Salesforce?
Yes, using Data Loader or the “Add Multiple Users” feature
Q2: What is the best way to create bulk users?
Data Loader is the most efficient method
Q3: Can we update user records using the Data Loader?
Yes, using Update operation
Q4: Why is the username unique in Salesforce?
Because it is used for login globally
Q5: Can we upload users without a Role ID?
Yes, Role ID is optional in some cases
Conclusion
Inserting multiple users using the Data Loader in Salesforce is a powerful, time-saving approach for administrators.
Instead of manually creating each user, you can prepare a CSV file and upload all users in just a few steps. This not only improves efficiency but also ensures consistency and accuracy in user data.
However, to avoid errors, it is important to understand required fields, maintain data quality, and follow best practices.
By validating properly, checking for duplicate usernames, and verifying field mappings, you can successfully insert users without issues.
If you are working as a Salesforce Admin or preparing for certification, mastering Data Loader is a must-have skill. It helps you handle real-world scenarios efficiently and improves your overall productivity.
You may like to read:
- Freeze User’s Account Using Salesforce Flow
- Auto-Deactivate Users with Schedule-Triggered Flow in Salesforce
- Activate or Deactivate a User From Salesforce Apex
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.