Skip to content

Value Transformers

A value transformer is a named function you can apply to a field mapping in your mapping configuration to modify a value before it is written to the target system. Transformers are specified with a transform key and an optional options object inside a field mapping entry.

Transformer names are case-insensitive. If a transformer receives a value it cannot process (for example, a non-numeric string passed to toInt), the normalization or transformation stage fails for that record.

TransformerInput typeOutput typeDescription
sapYesNo"Y" or "N" stringbooleanConverts SAP-style Y/N flags to true / false. Use in the normalization block for boolean fields coming from SAP Business One.
boolToStatusbooleanstringConverts true / false to custom string labels. Configure the labels with trueValue and falseValue options. Useful when the target expects a status string like "ACTIVE" / "INACTIVE".
formatDecimaldecimal or numeric stringstringFormats a decimal number to a fixed number of decimal places. Use the decimals option to set precision.
dateFormatdate or datetime stringstringFormats a date or datetime value using a custom format pattern (for example, "yyyy-MM-dd"). Use the format option to specify the pattern and the optional timezone option to convert time zones.
lookupanyanyMaps a source value to a replacement value using a key-value table. Use the map option to define the table and the optional default option for values not found in the map.
toStringanystringConverts any value to its string representation. Useful when the target field is typed as a string but the source value may be numeric or boolean.
toIntstring or decimalintegerConverts a value to an integer. Truncates decimals without rounding.
toDecimalstring or integerdecimalConverts a value to a decimal number.
toBoolanybooleanConverts a value to a boolean. Non-empty strings and non-zero numbers evaluate to true; empty strings, null, and 0 evaluate to false.
{
"transform": "sapYesNo",
"options": { "trueValue": "Y", "falseValue": "N" }
}
{
"transform": "boolToStatus",
"options": { "trueValue": "ACTIVE", "falseValue": "INACTIVE" }
}
{
"transform": "formatDecimal",
"options": { "decimals": 2 }
}
{
"transform": "dateFormat",
"options": { "format": "yyyy-MM-dd", "timezone": "UTC" }
}
{
"transform": "lookup",
"options": {
"map": {
"STANDARD": "TAX-STD",
"EXEMPT": "TAX-EXEMPT",
"ZERO": "TAX-ZERO"
},
"default": "TAX-STD",
"caseInsensitive": true
}
}

Transformers can be applied in both the normalization block and the transformation block of a mapping config:

  • Normalization block — use transformers to clean and type-convert raw source values before they enter the canonical entity. For example, use sapYesNo to convert a "Y"/"N" flag to a boolean isActive field.
  • Transformation block — use transformers to format canonical values for the target system. For example, use formatDecimal to ensure a price field always has two decimal places when sent to Shopify.

If the built-in transformers do not cover a specific conversion need, contact your EZY Integrations administrator. New transformer types can be added to the system and will appear in this list once deployed.