Transformations¶
A transformation cleans a source value on the way in. They are chained per mapped column, in the order you add them, and every one runs while the plan is being written — so the value the preview shows you is the literal value apply will write.
A value a transformation cannot make sense of is passed through unchanged rather than replaced with a guess, so the field's own check reports it against what your file actually said.
| Transformation | Takes | Returns |
|---|---|---|
trim |
— | The value with leading and trailing whitespace removed. |
upper |
— | The value in upper case, accents included. |
lower |
— | The value in lower case, accents included. |
title |
— | The value with the first letter of each word capitalised. |
strip_tags |
— | The value with any HTML tags removed and entities decoded. |
squeeze |
— | The value with every run of whitespace — non-breaking spaces and line breaks included — reduced to one space, and trimmed. |
prefix |
text |
The text followed by the value. |
suffix |
text |
The value followed by the text. |
truncate |
length |
The first length characters of the value, or the whole value when it is already shorter. |
replace |
search, replace |
The value with every occurrence of search replaced by replace. |
regex_replace |
pattern, replace |
The value with everything matching the regular expression pattern replaced by replace. A pattern that will not compile leaves the value alone. |
extract |
pattern, group |
Capture group group of the first match of pattern, or the value unchanged when it does not match. |
split |
separator, index |
Part index of the value split on separator, counting from 0. An index past the end gives an empty value. |
digits |
— | Only the digits in the value, so SKU-0042 becomes 0042. |
number |
— | The value read as a number and written the way a database stores one: thousands separators dropped and a decimal comma turned into a point, so 1.234,56 becomes 1234.56. |
round |
decimals |
The value rounded to decimals decimal places. |
multiply |
factor |
The value multiplied by factor — a supplier price plus a margin, or grams into kilograms. |
add |
amount |
The value with amount added to it. A negative amount subtracts. |
date |
format, read as |
The value re-written in format, reading it as read as when given — which is how 31/12/2024 is told apart from 12/31/2024. |
default |
value |
The value, or value when the source left it empty. |
under |
parent path |
A category path filed under parent path, unless it already names a parent of its own. Widgets under Home becomes Home > Widgets; Clearance > Tools is left where it is. |
lookup |
pairs, fallback |
What pairs maps the value to, written in=out\|in=out. A value in no pair becomes fallback, or stays as it is when no fallback is given. |
boolean |
— | The value read as a yes or a no and written as 1 or 0. Anything it cannot read is passed through so the field reports it against what the file actually said. |