Skip to main content
Version: Latest (4.57.0)

Load Mapping

The Load Mapping component allows you to read mapping workbooks into the Content Store. These mappings will be stored in the mappings collection.

To read and use mappings you can use the following functions in the Code component and the HTTP Request component:

  • lookup
  • lookupByKey
  • lookupByField
  • getMappingKeys

Each sheet in a mapping workbook needs to have a column name, which is specified in the first row. Prefix a column name with an asterisk * to mark it as a key. You can prefix multiple columns to specify combined lookup fields. At least one column needs to be prefixed. A mapping workbook doesn't need to have any specific format and each sheet will be read automatically.

Example mapping Excel sheet:

*name*lastNamestreetnumbercity
MarkMikeMain Street12Los Angeles
MorganFreemanFirst Avenue24Washington DC

To access a mapping, use the combined mapping name which consists of the workbookName without the extension and the sheetName separated by a -. Note that all names are lowercase. The same goes for the column names.

For example:

The mappings in a workbook with the name myMappings.xlsx that contains the following sheets: states, persons can be access by using the following names: mymappings-states and mymappings-persons

Optionally, you can specify if existing mappings should be deleted prior to inserting and if each cell should be trimmed.

note

Empty rows are fully ignored

For more information on using the mapping functions, see the Code component.

Configuration

Inputs | Outputs


Load Mapping
Input
Output
Error
00 0 (ilsyxu266)

Any message will make the component start reading the file from the path that is given in the configuration. However, the path can be overwritten by sending { path: "/path/to/file.xlsx" } to the input.

Example:

{
"path": "/path/to/file.xlsx"
"deleteExistingMappings": true,
"trimCell": true
}