Skip to main content

Using Mappers to Map Data to Toolio Attributes

Learn how to create a Mapper, write mapping formulas (including string concat, arithmetic, conditionals, and date functions), set a default Mapper, and use Mappers in imports.

Sometimes, if the data feed that you provide does not meet Toolio’s standard format requirements, you will need to create a Mapper to map your fields into Toolio’s required fields. Mapping allows Toolio to extract necessary fields that may have a different format in your source.

Creating a new Mapper

Go to Account > Data & Imports > Mappers

Select New Mapper on the right hand side.

Fill out the necessary fields:

  • Mapper Name: The name for the Mapper you are creating

  • Context: Type of data feed (Inventory, Sale, etc.)

  • Default: Whether the Mapper should be the default for an import for the given Data Feed? (Automated data feeds will choose this mapper as the default)

  • Header line number: The line number that contains the header information

Upon creating the Mapper, you'll be taken to fill out the specific fields you want the values to be mapped to.

Click within Mappings to add your formula to map the correct fields.

Click Save to confirm these changes.

Mapper Formula Reference

Each mapping field accepts a formula that tells Toolio how to derive the target value from one or more columns in your source file. Formulas can be as simple as referencing a single column or as complex as conditional logic with date calculations.

Referencing Source Columns

Use curly braces to reference a column from your source file by its header name.

  • String context — wrap the reference in single quotes: '{Column_Name}'

  • Numeric context — no quotes needed: {Column_Name}

The column name inside the curly braces is case-insensitive and must match your file's header exactly (spaces are allowed).

Goal

Formula

Use a string column as-is

'{Style_Color}'

Use a numeric column as-is

{Units_Sold}

Hardcode a literal string value

'active'

String Operations

Goal

Formula

Concatenate two columns

'{Style_Code}' + '{Color_Code}'

Add a separator between columns

'{Style_Code}' + '_' + '{Color_Code}'

Combine three columns into a composite key

'{Style_Code}' + '_' + '{Account_ID}' + '_' + '{Week_Date}'

Convert to lowercase

'{Status}'.toLowerCase()

Convert to uppercase

'{Status}'.toUpperCase()

Numeric Operations

Use columns directly (no quotes) for arithmetic. You can mix column references with literal numbers.

Goal

Formula

Multiply a column by a constant

{Units_Sold} * 100

Negate a value

{Cost} * -1

Subtract one column from another

{Gross_Revenue} - {Net_Revenue}

Absolute value

Math.abs('{Discount}')

Type Conversion Functions

Use these when your source column contains numbers formatted with currency symbols or thousand separators that need to be treated as numeric values.

NUMBER('{Column_Name}') — Converts a string to a decimal number. Strips currency symbols ($, £), comma separators, and handles negatives. Returns 0 for null or empty values.

INTEGER('{Column_Name}') — Same as NUMBER() but rounds the result to the nearest whole number.

Goal

Formula

Convert $1,234.50 to 1234.5

NUMBER('{Retail_Price}')

Convert 1234.7 to 1235

INTEGER('{Units}')

Use a converted number in arithmetic

NUMBER('{Cost}') * 100

Date Functions

Goal

Formula

Parse a date from your source

new Date('{Ship_Date}')

Use today's date

new Date(Date.now())

Use the later of two dates (e.g. floor to today)

new Date(Math.max(Date.now(), new Date('{Requested_Ship_Date}')))

Conditional Logic

Use JavaScript ternary syntax: condition ? value_if_true : value_if_false

Goal

Formula

Map a status to a simpler value

'{Status}'.toLowerCase() !== 'closed' ? 'active' : 'closed'

Return a quantity only for active statuses

'{Status}' === 'ORDERED' \|\| '{Status}' === 'IN-TRANSIT' ? NUMBER('{Quantity}') : 0

Multi-value OR condition

'{Status}' === 'ORDERED' \|\| '{Status}' === 'ALLOCATED' \|\| '{Status}' === 'ISSUED' ? NUMBER('{Quantity}') : 0

Supported comparison operators: ===, !== Supported logical operators: || (or), && (and)

Compound Examples

Goal

Formula

Composite key with readable separator

'{PO_Number}' + ' - ' + '{Size}'

Conditional quantity with type conversion

'{Order_Status}' === 'ORDERED' ? NUMBER('{Order_Qty}') : 0

Date ceiling (never earlier than today)

new Date(Math.max(Date.now(), new Date('{Ex_Factory_Date}')))

Absolute value of a discount field

Math.abs('{Discount_Amount}')

Using a Mapper in Imports

After creating a Mapper, you can start using the Mapper through automated data feed or importing data feed manually.

If you automatically import your data feed into Toolio, you can choose to edit the data feed Mapper to set to default.

You can also choose to remove the default option if you no longer want it set to default.

If you manually import your data feed into Toolio, you can choose to use the System (Toolio default) Mapper or your own Mapper that you've created.

  • Go to Account > Data & Imports > Imports

  • Select New Import and the core model that you're interested in using

Related Articles

Did this answer your question?