Newer Version Available
Map Columns
| Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions |
- Create a new mapping file and give it an extension of .sdl.
- Observe the following syntax:
- On each line, pair a data source with its destination.
- In an import file, put the data source on the left, an equals sign (=) as a separator, and the destination on the right. In an export file, put the destination on the left, an equals sign (=) as a separator, and the data source on the right.
- Data sources can be either column names or constants. Surround constants with double quotation marks, as in “sampleconstant”. Values without quotation marks are treated as column names.
- Destinations must be column names.
- You may map constants by surrounding them with double quotation marks, as in:
1"Canada"=BillingCountry
- In your configuration file, use the parameter process.mappingFile to specify the name of your mapping file.
Column Mapping Example for Data Insert
The Salesforce fields are on the right.
1SLA__C=SLA__c
2BILLINGCITY=BillingCity
3SYSTEMMODSTAMP=
4OWNERID=OwnerId
5CUSTOMERPRIORITY__C=CustomerPriority__c
6ANNUALREVENUE=AnnualRevenue
7DESCRIPTION=Description
8BILLINGSTREET=BillingStreet
9SHIPPINGSTATE=ShippingStateColumn Mapping Example for Data Export
The Salesforce fields are on the left.
1Id=account_number
2Name=name
3Phone=phoneColumn Mapping for Constant Values
Data Loader supports the ability to assign constants to fields when you insert, update, and export data. If you have a field that should contain the same value for each record, you specify that constant in the .sdl mapping file instead of specifying the field and value in the CSV file or the export query.
The constant must be enclosed in double quotation marks. For example, if you’re importing data, the syntax is "constantvalue"=field1.
If you have multiple fields that should contain the same value, you must specify the constant and the field names separated by commas. For example, if you’re importing data, the syntax would be "constantvalue"=field1, field2.
Here’s an example of an .sdl file for inserting data. The Salesforce fields are on the right. The first two lines map a data source to a destination field, and the last three lines map a constant to a destination field.
1Name=Name
2NumEmployees=NumberOfEmployees
3"Aerospace"=Industry
4"California"=BillingState, ShippingState
5"New"=Customer_Type__cA constant must contain at least one alphanumeric character.