Skip to main content
Transform data using JavaScript code. Use this when the change you need is easier to express as a small script than to assemble from individual transformers, for example a custom calculation, a conditional rewrite, or building a new structure from several fields. You pick the data to work on, write JavaScript that returns the new value, and tell Alumio where to store the result. The data you select is handed to your script in a variable called data, and whatever your script returns is written back into the entity at the destination you choose. Please note that this feature is currently in beta and is still under development, so its behaviour may change as it is refined.

Fields

Sample data

FieldValue
Source&{product}
Destinationproduct.priceInclVat
Codereturn Math.round(data.priceExclVat * 1.21 * 100) / 100;
Input:
{
    "product": { "name": "Wool scarf", "priceExclVat": 40 }
}
Output:
{
    "product": {
        "name": "Wool scarf",
        "priceExclVat": 40,
        "priceInclVat": 48.4
    }
}