Rules engine – Actions
The list of available actions depends on the type of the target field.
Mapping vs Formulas
The rules engine provides two complementary tools that share a common set of concepts (conditions, actions, templates, operators) but behave differently:
Rules Engine mappings
- Configured in the Product‑Live UI, between a source table and a target table.
- Mainly used to transfer and transform data between partners (supplier → retailer, internal → external, etc.).
- Rules are executed asynchronously (on demand or scheduled, for example nightly) on the whole target table or a subset of items.
- Actions available in the UI correspond to the internal actions
SET_TEXT,SET_NUMBER,SET_IMAGE,SET_ATTACHMENT,SET_CATEGORY, etc.
Formulas
- Configured at table schema level, usually via Data Factory (XML) on a single table (no source/target tables, the table is both the source and the target).
- Mainly used to compute or maintain fields inside one table (identifiers, derived attributes, validation helpers, cascading select, composite keys, etc.).
- Rules are executed immediately (or very shortly) when an item is created/updated or when items are imported.
- Use the same actions under the hood (
SET_TEXT,SET_NUMBER,SET_SELECTABLE_OPTIONS,REMOVE_VALUE, etc.) and the same template engine (Twig).
The rest of this page focuses on what you can do per target field type; whether you use mappings or formulas, the underlying actions and allowed source types are the same (except when explicitly noted).
Text target field
A Text target field can be of the following types:
IDENTIFIERSINGLE-LINE-TEXTLONG-TEXTHTML-TEXT
Text available actions
- Use a value from another field
- Use a default value
- Apply a template Templates allow you to build advanced formulas using the Twig language. See the dedicated page: Templates (advanced formulas).
xml
<Action type="SET_TEXT">
<Copy source="description" remove-carriage-returns="true" trim-spaces="true" />
</Action>1
2
3
2
3
xml
<Action type="SET_TEXT">
<Value>Hello world</Value>
</Action>1
2
3
2
3
xml
<Action type="SET_TEXT">
<Template trim-spaces="true" engine="twig.1">
<![CDATA[
<b>Composition</b>
<br></br>
{{source("COMPOSITION")}}
<br></br>
<br></br>
<b>Materials</b>
<br></br>
{{source("MATERIALS","title")}}
]]>
</Template>
</Action>1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Text allowed source fields
For a Text target field, you can use source fields with type:
IDENTIFIERSINGLE-LINE-TEXTLONG-TEXTHTML-TEXTNUMBER, the.is used as a decimal separator and cannot be customizedSINGLE-SELECT, you must choose between using thekey, thetitleor thetitle-localof the optionMULTIPLE-SELECT, you must choose between using thekey, thetitleor thetitle-localof the option, the final value will be joined by;MULTIPLE-SELECT-QUANTIFIED, same as above, joined with;using template[quantity] :[value]MULTIPLE-SELECT-QUANTIFIED-WITH-COMMENTS, same as above, joined with;using template[quantity] :[value],[comment]CLASSIFICATION, you must choose between using thekey, thetitleor thetitle-localof the categoryIMAGE, the public URL of the file is usedATTACHMENT, the public URL of the file is used
Number target field
Number available actions
- Use value from another field
- Use a default value
- Use a formula Templates allow you to build advanced formulas using the Twig language. See Templates (advanced formulas) for more details.
xml
<Action type="SET_NUMBER">
<Copy source="PRICE" precision="2" round="UP" suffix="EURO"/>
</Action>1
2
3
2
3
xml
<Action type="SET_NUMBER">
<Value>12.3</Value>
</Action>1
2
3
2
3
xml
<Action type="SET_NUMBER">
<Template precision="0" round="CEILING" engine="twig.1">
<![CDATA[
{{source("WIDTH_MM")}} / 10
]]>
</Template>
</Action>1
2
3
4
5
6
7
2
3
4
5
6
7
Number allowed source fields
For a NUMBER target field, you can use source fields with type:
NUMBER
If you need to use a Text field as source, see the advanced tutorial Map a Text field to a Number field.
Suffixes
When the target field is a Number with suffixes, you can set the suffix to be applied with the value. A single suffix can be set per rule.
If you need to automate a number with distinct suffixes:
- Either use conditions on the suffix, see Conditions
- Or create one rule per target suffix
Rounding methods
For rounding methods, see: Rounding methods.
Single or Multiple Select target field
Single or Multiple Select available actions
- Use value from another field (you will be able to map each option)
- Use a default value
xml
<Action type="SET_OPTION">
<Map source="MAIN_COLOR">
<Entry source="RED" target="RED" />
<Entry source="BURGUNDY" target="RED" />
<Entry source="MAGENTA" target="RED" />
<Entry source="BLUE" target="BLUE" />
<Entry source="AZURE" target="BLUE" />
<Entry source="PETROL" target="BLUE" />
<Entry source="GREEN" target="GREEN" skip="true" />
<Entry source="YELLOW" skip="true" />
</Map>
</Action>1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
xml
<Action type="SET_OPTION">
<Value>RED</Value>
</Action>1
2
3
2
3
Single or Multiple Select allowed source fields
For a SINGLE-SELECT or MULTIPLE-SELECT target field, you can use source fields with type:
SINGLE-SELECTMULTIPLE-SELECTMULTIPLE-SELECT-QUANTIFIEDMULTIPLE-SELECT-QUANTIFIED-WITH-COMMENTSCLASSIFICATION
Archived options and categories are displayed by default so that you can check if one of them has to be updated. You can hide them to focus on relevant values only.
You can explicitly mark options that must not be mapped to better see which ones remain to automate.
If you need to use a Text or NUMBER field as source, see Advanced mappings.
Classification target field
Classification available actions
- Use value from another field (you will be able to map each category)
- Use a default value
xml
<Action type="SET_CATEGORY">
<Map source="TYPOLOGY">
<Entry source="laveVaisselle" target="DISHWASHER" />
<Entry source="frigo" target="FRIDGE" />
<Entry source="réfrigérateur" target="FRIDGE" />
<Entry source="congélateur" target="FREEZER" skip="true" />
<Entry source="four" skip="true" />
</Map>
</Action>1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
xml
<Action type="SET_CATEGORY">
<Value>FRIDGE</Value>
</Action>1
2
3
2
3
Classification allowed source fields
For a CLASSIFICATION target field, you can use source fields with type:
SINGLE-SELECTMULTIPLE-SELECTMULTIPLE-SELECT-QUANTIFIEDMULTIPLE-SELECT-QUANTIFIED-WITH-COMMENTSCLASSIFICATION
Archived options and categories are displayed by default so that you can check if one of them has to be updated. You can hide them to focus on relevant values only.
You can explicitly mark categories that must not be mapped to better see which ones remain to automate.
If you need to use a Text or NUMBER field as source, see Advanced mappings.
Image target field
Image available actions
- Use value from another field
xml
<Action type="SET_IMAGE">
<Copy source="FRONT_VIEW" width-px="1000" height-px="1000" quality="90" format="jpg" />
</Action>1
2
3
2
3
Image allowed source fields
For an IMAGE target field, you can use source fields with type:
IMAGE
You can transform the size of images with the Resize image option.
Attachment target field
Attachment available actions
- Use value from another field
xml
<Action type="SET_ATTACHMENT">
<Copy source="INSTRUCTIONS" />
</Action>1
2
3
2
3
Attachment allowed source field types
For an ATTACHMENT target field, you can use source fields with type:
ATTACHMENT
Date and Date time target field
Date and Date time available actions
- Use value from another field
xml
<Action type="SET_TEXT">
<Copy source="offer_date" />
</Action>1
2
3
2
3
Date and Date time allowed source field types
For a DATE or DATE-TIME target field, you can use source fields with type:
DATEDATE-TIME