Field mapping & transformations

Transformation rule reference

The transform syntax for cleaning and reformatting values as they flow through a mapping.

A mapping's transform is a chain of operations separated by |, applied to the value in order, left to right. Operations that take an argument use a colon, e.g. prepend:SKU-; operations with multiple arguments separate them with a comma, e.g. replace:old,new.

Operations

SyntaxEffect
trimStrips leading and trailing whitespace. (strip is an alias for the same operation.)
uppercaseConverts the value to upper case.
lowercaseConverts the value to lower case.
prepend:valueAdds value before the current value.
append:valueAdds value after the current value.
default:valueSubstitutes value only when the current value is empty.
static:valueReplaces the value unconditionally with value, ignoring the source.
replace:from,toReplaces every occurrence of from with to.
number_format:decimalsFormats a numeric value to a fixed number of decimal places (default 2 if omitted).
currency:CODEWrites a number as a Google-style price with two decimals and an ISO 4217 code, for example 29.99 USD. Leave the code out (currency) to use the feed's currency. Empty and non-numeric values are left as they are.
yes_noWrites true/false values (1/0, yes/no) as Google's yes or no, for attributes such as identifier_exists.
plain_textRemoves HTML tags and decodes entities, so a description such as <p>Soft <b>cotton</b></p> becomes Soft cotton. OpenAI product feeds require plain-text descriptions.
chatgpt_availabilityWrites availability in OpenAI's spelling: preorder becomes pre_order and in stock becomes in_stock. Values it does not recognise are left unchanged.

Examples

trim | uppercase

Cleans whitespace, then upper-cases the value — useful for normalizing an identifier column.

prepend:SKU-

Turns 1042 into SKU-1042.

default:0

Fills a blank price or quantity field with 0 instead of leaving it empty.

replace:USD, | trim | prepend:$

Turns USD 19.99 into $19.99. Spaces around replace arguments are trimmed, so strip the code first, then clean up the leftover space.

number_format:2

Formats a price like 19.9 as 19.90.

Ready to build your first feed?

Start free and connect your first channel in minutes — no code required.

Start free