Using SFDC Data Loader via Command Prompt
To run DataLoader at command prompt, make sure you have latest Java Runtime Environment (JRE) installed.
1. Setup Data Loader in your Laptop
Download Data Loader from Setup->Integrations->Data Loader
Extract files and run install.bat. If you don't mention folder name in installation then by default dataloader will be installed at C:\Users\{userName}\dataloader\. For this blog, lets assume this is the installation folder to run the scripts.
After installing data loader files will look like shown in below folder.
2. Create Encrypted Password for SFDC user login
In command prompt go to bin folder of dataloader installation folder.
Generate encryption file using below command. If you dont give key path then key is created in .dataloader folder inside system user folder.
encrypt.bat —k [path to key file]
encrypt.bat –e [password] [key file path]
#Mapping values
#Source=Destnation
Name=Name
NumberOfEmployees=NumberOfEmployees
Industry=Industry
IsActive=IsActive__c
Once encryption key is created, embed SF user password into it using below command:
Note: Run these command at bin folder because enncrypt.bat is available in bin folder.
Copy the generated key to use it in dataloader config later.
3. Create Mapping File
Mapping file contains mapping between CSV file (source file) and Salesforce object fields (Target)
Copy paste below mapping into accountInsertMap.sdl file.
#Source=Destnation
Name=Name
NumberOfEmployees=NumberOfEmployees
Industry=Industry
IsActive=IsActive__c
4. Create Configuration Setting File
Config file contains all important information which data loader needs to perform data updates. When you install dataloader, you get sample config file in Sample folder. Copy paste this file in .dataloader folder and do below changes.
4. Running Process
Lets say accountData.csv has below records:
To run dataloader to insert above records into Account object run command in below format:
Comments