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.
Built-in transformers
Section titled “Built-in transformers”| Transformer | Input type | Output type | Description |
|---|---|---|---|
sapYesNo | "Y" or "N" string | boolean | Converts SAP-style Y/N flags to true / false. Use in the normalization block for boolean fields coming from SAP Business One. |
boolToStatus | boolean | string | Converts 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". |
formatDecimal | decimal or numeric string | string | Formats a decimal number to a fixed number of decimal places. Use the decimals option to set precision. |
dateFormat | date or datetime string | string | Formats 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. |
lookup | any | any | Maps 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. |
toString | any | string | Converts 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. |
toInt | string or decimal | integer | Converts a value to an integer. Truncates decimals without rounding. |
toDecimal | string or integer | decimal | Converts a value to a decimal number. |
toBool | any | boolean | Converts a value to a boolean. Non-empty strings and non-zero numbers evaluate to true; empty strings, null, and 0 evaluate to false. |
Transformer options reference
Section titled “Transformer options reference”sapYesNo
Section titled “sapYesNo”{ "transform": "sapYesNo", "options": { "trueValue": "Y", "falseValue": "N" }}boolToStatus
Section titled “boolToStatus”{ "transform": "boolToStatus", "options": { "trueValue": "ACTIVE", "falseValue": "INACTIVE" }}formatDecimal
Section titled “formatDecimal”{ "transform": "formatDecimal", "options": { "decimals": 2 }}dateFormat
Section titled “dateFormat”{ "transform": "dateFormat", "options": { "format": "yyyy-MM-dd", "timezone": "UTC" }}lookup
Section titled “lookup”{ "transform": "lookup", "options": { "map": { "STANDARD": "TAX-STD", "EXEMPT": "TAX-EXEMPT", "ZERO": "TAX-ZERO" }, "default": "TAX-STD", "caseInsensitive": true }}Where transformers can be used
Section titled “Where transformers can be used”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
sapYesNoto convert a"Y"/"N"flag to a booleanisActivefield. - Transformation block — use transformers to format canonical values for the target system. For example, use
formatDecimalto ensure a price field always has two decimal places when sent to Shopify.
Custom transformers
Section titled “Custom transformers”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.
Related
Section titled “Related”- Mapping Configuration — How to include transformers in a field mapping entry.
- Output Writers — How the Flat File and Generic API connectors write transformed output.