On Records Import
- Last UpdatedJul 28, 2026
- 1 minute read
Use scripts for the On Records Import event of a Base Form container to customize the mapping of CSV column headers to Base Form fields before imported records are populated into the Base Form. This property is available in Base Form > Advanced > On Records Import.
Example 1
If the CSV column names do not match the XML node names of the Base Form fields, you can define custom header mappings as follows:
var headersMap = {
Asset_Id: "EquipmentID",
Asset_Name: "Equipment Name",
Vendor_Name: "Supplier",
Warranty_Period: "Warranty Expiry"
};
control.csvHeadersMap = headersMap;
Note:
- If a CSV header contains spaces or special characters, enclose the header name in
double quotes.
- The script runs after the CSV file is parsed and before imported data is populated
into the Base Form.
- If a mapping script fails during execution, the import operation fails and records
are not partially populated.
Example 2
You can also define header mappings dynamically by retrieving values from other controls in the Base Form.
For example, the following script:
var headersMap = {
AssetId: "EquipmentId",
AssetName: "EquipmentName",
Vendor_Name: [control.findByXmlNode("VendorNameFormControlName").value],
[control.findByXmlNode("PlantLocationFromCSV").value]: "PlantLocation"
};
control.csvHeadersMap = headersMap;
VendorNameFormControlName provides the target Base Form field (the value) and PlantLocationFromCSV provides the source CSV column header (the key).