Transforms#
A transform changes a field’s value before it’s written. In provisioning XML, use the code as transform=.
| Code | Label | What it does |
|---|---|---|
none |
none | Writes the value as is. The default. |
strip_html |
strip HTML | Removes HTML tags, turns line breaks and tabs into spaces, collapses repeated spaces and trims the ends. Keeps descriptions on one line, which CSV channels need. |
full_image_url |
full image URL | Turns each comma-separated image path into a full URL using the domain’s graphics root. Main Image and Additional Images do this already. |
raw_json |
embed as raw JSON (no escaping) | JSON output only. Writes the value as JSON instead of a quoted string. Use it for a value that’s already JSON. |
raw_row |
Use Value as Feed | Writes the value as the whole row. Only works when it’s the only field. See Use with Feed Builder. |
Price and Sale Price get their currency code after the transform. Shipping dimensions get their unit.
Conditions#
Conditions appear in two places with the same operators:
- the Source tab’s conditions, which choose records (Feed Builder only)
- a field’s conditional output, which changes the field’s value
| Code | Label | True when the field |
|---|---|---|
is_empty |
is empty | is blank |
is_not_empty |
is not empty | has a value |
equals |
equals | equals the value, ignoring case |
not_equals |
not equals | doesn’t equal the value, ignoring case |
contains |
contains | contains the value, ignoring case |
greater_than |
greater than | is greater than the value |
less_than |
less than | is less than the value |
Conditions compare the value before the transform and before the currency code is added, so a price condition uses 10, not 10.00 USD.
Conditional output#
A field with conditional output checks its rules top to bottom. The first rule that matches sets the output. When none matches, Otherwise output is used, or the normal value if that’s blank.
A rule with an empty output leaves the field out of the row:
- CSV: the cell is empty
- JSON: the property is left out
- XML: the element is left out
Examples#
Leave sale_price out when there’s no discount:
| Field | Operator | Output |
|---|---|---|
| Sale Price | is empty | (empty) |
Google availability:
| Field | Operator | Value | Output |
|---|---|---|---|
| Availability | equals | in stock | in_stock |
Otherwise output: out_of_stock
Flag variant rows:
| Field | Operator | Output |
|---|---|---|
| Item Group ID | is not empty | true |
Otherwise output: false
In provisioning XML:
<Field source="in_stock" output="g:availability">
<Condition field="in_stock" operator="equals" value="in stock" output="in_stock" />
<ConditionsDefault>out_of_stock</ConditionsDefault>
</Field>
<Field source="sale_price" output="g:sale_price">
<Condition field="sale_price" operator="is_empty" output="" />
</Field>