Rules engine
What is the rules engine?
The rules engine allows to automate data entry on tables. Either your own table, or from another table.
Why?
Map data
Your partners ask you to complete many attributes, however you usually already have this information in your systems, so what you need is to automate data entry.

By connecting Product-Live to your systems, or using Product-Live as your main data source, you can then map your attributes to those of your partners, so you don't have to re-enter information when possible.

See use cases in Map fields section below.
Automate data
Various data are derived from other information, such as pricing (calculated from base price, discounts, and taxes), dimensions, default values based on item categories, and specific options subsets tailored to product categories (e.g., DEA, DEEE).
By connecting Product-Live to your systems, or using Product-Live as your main data source, you can then automate attributes based on other attributes, so you don't have to re-enter information when possible and ensuring data quality.
See use cases in Automate fields section below.
How to prioritize
Please consult the following document for best practices Mapping Methodology (French version).
Map fields
Field mapping execution on target tables is asynchronous and executed on demand, which means that an administrator must configure the periodicity of the execution of the rules. Usually Product-Live team has configured a periodic execution done during the night. If you want to learn more contact Product-Live support.
You can also select a list of items and directly applying the rules, but for this your administrator must have configured an action. If you want to learn more contact Product-Live support.
Mapping use cases
Map a Text column to a Number column
- To be filtrable and sortable a number must be stored as a number, otherwise you cannot sort numbers from highest to lowest or filter by range.
- If the source data is a text then it can be anything, therefore the conversion of the value from text to number is not predictable.
For example, 1,000.90 in US is equivalent to 1 000,90 in Europe, but 1,000 in US is not equivalent to 1,000 in Europe. Moreover some old systems store a NA value or - value when there is no value.
Data source that store numbers as text are old software that limit your business and you should consider upgrading them.
The best solution is to update your data source from a Text column to Number column. If your source system cannot do that it's time to use Product-Live as your main data source. Our customer success teams can help you to refine your source data structure with best practices. You can contact our customer success team here: contact the customer success team.
If you cannot change your data source, then you can use the conditions to create one rule for each text input. To do so, in Action select Use a default value and set a value. Then in Conditions setup the conditions when this value must be used.
You will have a setup like this:

Before saving click on add new rule:

You will be asked to enter a rule name, you can use the pattern: Name of the attribute for value

Click on Save and add a new rule. This will immediately open the same form. Fill the form with another value and conditions and click on Save. Then you will see your two rules like this:

Here you can change the execution order or create new rules.
Best practice
If you have a few predictable text inputs, then you can use conditions, but if the values are not predictable then there is no other solution to transform your data source to a Number column.
Map a Text or Number source column to a Select or Classification column
This is the same case as before. The problem is that Text or Number values cannot be predictable (imagine a Text value Green, which can also be written: green, GREEN, 104 = the color code...), therefore the bypass is to create a rule for each input value.
Map a Classification column depending on multiple source columns
In this example the start configuration is like below:

The target Products table of the retailer contains two fields :
- EAN the EAN 13 of the product
- Classification the classification used on the website, it can take two values:
- Vacuum cleaner wireless
- Vacuum cleaner with wire
The source Products table of the supplier contains these fields:
- EAN 13 the EAN 13 of the product
- Typology the typology of the product, it can take two values:
- Vacuum cleaner
- Coffee machine
- Type is a field specific to the category Vacuum cleaner and can take two values:
- Wireless
- With wire
What BrandX wants to express is:
In my Products table, if typology is vacuum cleaner and type is wireless then it must the classification must be set to vacuum cleaner wireless on RetailerX, else if typology is vacuum cleaner and type is with wire then it must the classification must be set to vacuum cleaner with wire on RetailerX.
For this like in the examples above we will create multiple rules on the same field.
First create a rule for the first case like this:

- In action click on Use a default value
- Select the value
- In Only if add a condition on the Typology field
- Then add a condition on the Type field
- Then click on + Add new rule and create the second rule and giv this name:

Then click on Save and add a new rule button and create this configuration:

Finally you should have this configuration:

Setup field mapping
Link target and source table
The rules engine must be activated on the target table and linked to one or multiple source tables.
Next to the target table click on the settings icon click on Link tables:

Here you define which table must used as a source, and which identifier must be used as pivot to find the "same" item.

Link target field
Go to the column to automate and click on AUtomate data entry:

This will open a panel on the right where you will configure the action and the conditions.
Action
The action depends on the data type of the column (text, number, image, select...).

In this example we are automating the data entry of a text column, so here we can:
- Use a value from another field
- Use a default value
- Concat fields
- Ignore field
When you ignore a field, no action will be performed on it. That allows you to exactly count how many fields remains to be mapped, excluding both mapped and ignored fields.
See the list of possible actions in What actions can be done? section below.
Conditions
You can define in which conditions the action will be executed. There can be multiple and advanced conditions in which cases the action will be performed.
This also allows to create multiple rules on the same column.

See the list of possible conditions actions in How to use conditions? section below.
Automate fields
Field automation execution is instantaneous; as soon as you modify a value used in a rule, the rule executes immediately, updating the corresponding field accordingly.
Automation use cases
Create compound identifier
If each product must be uniquely identified by a combination of the following fields: "Supplier" (single select) and "Supplier Ref" (single line text).
You need an Identifier to carry the uniqueness constraint.
xml
<Identifiers>
<Identifier key="SUPPLIER-SUPPLIER_REF" index="1" level="PRODUCT">
<Title>Supplier - supplier ref</Title>
</Identifier>
</Identifiers>1
2
3
4
5
2
3
4
5
You need two fields to carry the product value.
xml
<Fields>
<Field key="SUPPLIER" type="SINGLE-SELECT" level="PRODUCT">
<Title>Supplier</Title>
<Options>
<Option key="SUPPLIERX">
<Title>Supplier X</Title>
</Option>
<Option key="SUPPLIERY">
<Title>Supplier Y</Title>
</Option>
</Options>
</Field>
<Field key="SUPPLIER_REF" type="SINGLE-LINE-TEXT" level="PRODUCT">
<Title>Supplier reference</Title>
</Field>
</Fields>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
And a formula to concatenate these two fields value and apply that value to the identifier.
xml
<Formulas>
<Identifier key="SUPPLIER-SUPPLIER_REF">
<Rule priority="1">
<Conditions>
<Condition-Group>
<Condition source="SUPPLIER" operator="NOT_EMPTY" />
<Condition source="SUPPLIER_REF" operator="NOT_EMPTY" />
</Condition-Group>
</Conditions>
<Action type="SET_TEXT">
<Template trim-spaces="true"><![CDATA[{{source("SUPPLIER","key")}}-{{source("SUPPLIER_REF")}}]]></Template>
</Action>
</Rule>
</Identifier>
</Formulas>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
In this particular example:
- You must set a condition on both SUPPLIER and SUPPLIER_REF to not be empty
- The order of the concatenation matters.
Automate volume
If you need to determine a product's volume based on its dimensions, you can automate the calculation, saving yourself the tedious task of doing it manually for each product.
If you have these three dimension fields.
xml
<Fields>
<Field key="WIDTH_CM" type="NUMBER" level="PRODUCT">
<Title>Width</Title>
<Suffix>cm</Suffix>
<Precision>0</Precision>
</Field>
<Field key="HEIGHT_CM" type="NUMBER" level="PRODUCT">
<Title>Height</Title>
<Suffix>cm</Suffix>
<Precision>0</Precision>
</Field>
<Field key="DEPTH_CM" type="NUMBER" level="PRODUCT">
<Title>Depth</Title>
<Suffix>cm</Suffix>
<Precision>0</Precision>
</Field>
<Field key="VOLUME_CM_3" type="NUMBER" level="PRODUCT">
<Title>Volume</Title>
<Suffix>cm3</Suffix>
<Precision>0</Precision>
</Field>
</Fields>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
You can create this formula which will do the computing.
xml
<Formulas>
<Field key="VOLUME_CM_3">
<Rule priority="1">
<Conditions>
<Condition-Group>
<Condition source="WIDTH_CM" operator="NOT_EMPTY" />
<Condition source="HEIGHT_CM" operator="NOT_EMPTY" />
<Condition source="DEPTH_CM" operator="NOT_EMPTY" />
</Condition-Group>
</Conditions>
<Action type="SET_NUMBER">
<Template precision="0" round="CEILING"><![CDATA[{{source("WIDTH_CM")}} * {{source("HEIGHT_CM")}} * {{source("DEPTH_CM")}}]]></Template>
</Action>
</Rule>
</Field>
</Formulas>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Create dependant dynamic lists
You want to model the selectable values on a list field depends on the value selected on another field.
For example if you have a Products table with fields: Supplier and DEEE scale, you want to model that selectable values in DEEE scale depends on the value selected in Supplier.
Based on these supplier and DEEE scale fields.
xml
<Fields>
<Field key="SUPPLIER" type="SINGLE-SELECT" level="PRODUCT">
<Title>Supplier</Title>
<Options>
<Option key="SUPPLIER-1">
<Title>Supplier 1</Title>
</Option>
<Option key="SUPPLIER-2">
<Title>Supplier 2</Title>
</Option>
<Option key="SUPPLIER-3">
<Title>Supplier 3</Title>
</Option>
</Options>
</Field>
<Field key="DEEE_SCALE" type="SINGLE-SELECT" level="PRODUCT">
<Title>DEEE scale</Title>
<Options>
<Option key="DEEE-1">
<Title>DEEE 1</Title>
</Option>
<Option key="DEEE-2">
<Title>DEEE 2</Title>
</Option>
<Option key="DEEE-3">
<Title>DEEE 3</Title>
</Option>
</Options>
</Field>
</Fields>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
You can create this formula which will only display relevant options to users, and warn when unsupported options are used.
xml
<Formulas>
<Field key="DEEE_SCALE">
<Rule priority="1">
<Conditions>
<Condition-Group>
<Condition source="SUPPLIER" operator="IN">
<Value>SUPPLIER-1</Value>
<Value>SUPPLIER-2</Value>
</Condition>
</Condition-Group>
</Conditions>
<Action type="SET_SELECTABLE_OPTIONS">
<Value>DEEE-1</Value>
<Value>DEEE-2</Value>
</Action>
</Rule>
<Rule priority="2">
<Conditions>
<Condition-Group>
<Condition source="SUPPLIER" operator="IN">
<Value>SUPPLIER-3</Value>
</Condition>
</Condition-Group>
</Conditions>
<Action type="SET_SELECTABLE_OPTIONS">
<Value>DEEE-1</Value>
<Value>DEEE-3</Value>
</Action>
</Rule>
</Field>
</Formulas>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Best practice
As you can see above you can group conditions and use rule @priority to model the "If", "else if", "else if"...
You can use this to optimise your conditions, for example if multiple SUPPLIER share the same limitation, then do not create as many rules as you have SUPPLIER values, instead group SUPPLIER values that shares the same limitation in a single rule.
Limit options on single select fields depending on the category
You want to model the selectable values on a list field depends on the item category.
Based on this classification and below field.
xml
<Classifications>
<Classification key="TYPOLOGY">
<Title>Typology</Title>
<Categories>
<Category key="SHOES">
<Title>Shoes</Category>
<Category>
<Category key="T-SHIRT">
<Title>T-shirt</Category>
<Category>
<Category key="SHIRT">
<Title>Shirt</Category>
<Category>
</Categories>
</Classification>
</Classifications>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
xml
<Fields>
<Field key="SIZE" type="SINGLE-SELECT" level="PRODUCT">
<Title>Size</Title>
<Options>
<Option key="39">
<Title>39</Title>
</Option>
<Option key="40">
<Title>40</Title>
</Option>
<Option key="41">
<Title>41</Title>
</Option>
<Option key="42">
<Title>42</Title>
</Option>
<Option key="S">
<Title>S</Title>
</Option>
<Option key="M">
<Title>M</Title>
</Option>
<Option key="L">
<Title>L</Title>
</Option>
<Option key="XL">
<Title>XL</Title>
</Option>
</Options>
</Field>
</Fields>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
You can create this formula which will only display relevant options to users, and warn when unsupported options are used.
xml
<Formulas>
<Field key="SIZE">
<Rule priority="1">
<Conditions>
<Condition-Group>
<Condition source="TYPOLOGY" operator="EQUALS">
<Value>SHOES</Value>
</Condition>
</Condition-Group>
</Conditions>
<Action type="SET_SELECTABLE_OPTIONS">
<Value>39</Value>
<Value>40</Value>
<Value>41</Value>
<Value>42</Value>
</Action>
</Rule>
<Rule priority="2">
<Conditions>
<Condition-Group>
<Condition source="TYPOLOGY" operator="IN">
<Value>T-SHIRT</Value>
<Value>SHIRT</Value>
</Condition>
</Condition-Group>
</Conditions>
<Action type="SET_SELECTABLE_OPTIONS">
<Value>S</Value>
<Value>M</Value>
<Value>L</Value>
<Value>XL</Value>
</Action>
</Rule>
</Field>
</Formulas>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Here we have limited the size that can be selected depending the category.
Best practice
It is a best practice to limit options by categories instead of creating one field by category.
Calculate a status based on criteria on other fields
This can be very useful when you want to model a process. For example you will create a single select Field that represents the current step of the publication of a product on a website.
xml
<Fields>
<Field key="WEB_STATUS" type="SINGLE-SELECT" level="PRODUCT">
<Title>Web status</Title>
<Options>
<Option key="PUBLISHED" color="GREEN">
<Title>Published</Title>
</Option>
<Option key="READY_FOR_WEB" color="BLUE">
<Title>Ready for web</Title>
</Option>
<Option key="TODO" color="ORANGE">
<Title>To do</Title>
</Option>
</Options>
</Field>
</Fields>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
And then this formulas automatically set the current step of the product.
xml
<Formulas>
<Field key="WEB_STATUS">
<Rule priority="1">
<Conditions>
<Condition-Group>
<!-- Assuming that you have a WEB_PUBLICATION_DATE Field that is updated when the product is sent to the web -->
<Condition source="WEB_PUBLICATION_DATE" operator="NOT_EMPTY" />
</Condition-Group>
</Conditions>
<Action type="SET_OPTION">
<Value>PUBLISHED</Value>
</Action>
</Rule>
<Rule priority="2">
<Conditions>
<Condition-Group>
<!-- Assuming that you have a conditional formatting that defines what left to be done -->
<Condition source="WEB_COMPLIANCE" operator="EQUALS">
<Value>VALID</Value>
</Condition>
</Condition-Group>
</Conditions>
<Action type="SET_OPTION">
<Value>READY_FOR_WEB</Value>
</Action>
</Rule>
<Rule priority="3">
<Action type="SET_OPTION">
<Value>TO_DO</Value>
</Action>
</Rule>
</Field>
</Formulas>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Best practice
The rule with priority 1 must be the last step of your process. Therefore the last rule can be used to model a default value when none of the conditions above are met.
Generate a link to related items on another table
When you manage more types of items than just products such as logistics units, spare parts, prices... you may want to easily access to the related items without having to apply the same filters on the other table.
To do so you can create an extra HTML-TEXT field which will be fill with an automatic url pointing to the related items.
xml
<Field key="UL_LINK">
<Rule priority="1">
<Action type="SET_TEXT">
<Template trim-spaces="true"><![CDATA[
{% set ean = source("EAN") %}
{% set filter = base64_encode("[{\"fieldKey\": \"EAN\",\"operator\": \"equals\",\"criteria\": {\"list\": [\""+ean+"\"]}}]") %}
<a target="_blank" href="https://app.product-live.com/redirect?tableKey=LOGISTICAL_UNIT&filters={{filter}}">link</a>
]]></Template>
</Action>
</Rule>
</Field>1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Here an access link is set up pointing to the LOGISTICS_UNITS table and filtering items based on the EAN target field using the current item EAN value.
Setup field automation
Field automation is part of the table structure and needs administration rights to set. It requires to create Formulas rules in the table structure and to import it using the Data Factor table-import-schema task. See details here
What actions can be done?
It depends of the data type of the target column.
IDENTIFIER, SINGLE-LINE-TEXT HTML-TEXT and LONG-TEXT actions
Set a fixed text
The exact value to apply must be provided.
xml
<Action type="SET_TEXT">
<Value>Robot Tondeuse Top Surface de travail maximale de 3000 m² ou plus</Value>
</Action>1
2
3
2
3
Copy a text value
It is possible to copy a field value into a text field if the source field is one of the following.
Text source
A text source field is one of:
IDENTIFIERCLASSIFICATIONSINGLE-LINE-TEXTLONG-TEXTHTML-TEXT
The source field key must be provided. Then the source field value is applied to the target field.
xml
<Action type="SET_TEXT">
<Copy source="TITLE" />
</Action>1
2
3
2
3
NUMBER source
The source field key must be provided.
Here the number is converted to text without thousands separator and with the . as decimal separator. If no decimal is present in the source attribute, the separator is absent
xml
<Action type="SET_TEXT">
<Copy source="PRICE" />
</Action>1
2
3
2
3
SINGLE-SELECT source
A single select source field is a SINGLE-SELECT type field. The source field key must be provided.
By default the key of the Option is applied. You can apply the title or title-local by using the property use, with the language (lang) for the title-local.
xml
<Action type="SET_TEXT">
<Copy source="SUPPLIER_CODE" />
</Action>1
2
3
2
3
xml
<Action type="SET_TEXT">
<Copy source="COLOR" use="title-local" lang="fra" remove-carriage-returns="true" trim-spaces="true" />
</Action>1
2
3
2
3
MULTIPLE-SELECT... source
A multiple select source field is a MULTIPLE-SELECT, MULTIPLE-SELECT-QUANTIFIED or MULTIPLE-SELECT-QUANTIFIED-WITH-COMMENTS type field. The source field key must be provided.
- Options are joined by a
;[value];[value] - Quantity are joined by a
:[quantity]:[value];[quantity]:[value] - Comments are joined by a
,[quantity]:[value],[comment];[quantity]:[value],[comment]
By default the key of the Option is applied. You can apply the title or title-local by using the property use, with the language (lang) for the title-local.
xml
<Action type="SET_TEXT">
<Copy source="ACCESSORIES" />
</Action>1
2
3
2
3
xml
<Action type="SET_TEXT">
<Copy source="ACCESSORIES" use="title-local" lang="fra" remove-carriage-returns="true" trim-spaces="true" />
</Action>1
2
3
2
3
CLASSIFICATION source
A classification source field is a CLASSIFICATION type field. The source field key must be provided.
By default the key of the Option is applied. You can apply the title or title-local by using the property use, with the language (lang) for the title-local.
xml
<Action type="SET_TEXT">
<Copy source="HIERARCHY" />
</Action>1
2
3
2
3
xml
<Action type="SET_TEXT">
<Copy source="HIERARCHY" use="title-local" lang="fra" remove-carriage-returns="true" trim-spaces="true" />
</Action>1
2
3
2
3
Use a text template
It is possible to build up a text field value from the following source field:
IDENTIFIERCLASSIFICATIONSINGLE-LINE-TEXTLONG-TEXTHTML-TEXTNUMBERSINGLE-SELECT
TIP
If the attribute key contains a quote " , it must be doubled, example: la "composition" -> source="la ""composition""".
xml
<Action type="SET_TEXT">
<Template trim-spaces="true">
<![CDATA[{{source("SUPPLIER_REF")}}<br/>{{source("SUPPLIER","key")}}]]>
</Template>
</Action>1
2
3
4
5
2
3
4
5
xml
<Action type="SET_TEXT">
<Template trim-spaces="true">
<![CDATA[{{source("HIERARCHY", "key")}}]]>
</Template>
</Action>1
2
3
4
5
2
3
4
5
xml
<Action type="SET_TEXT">
<Template trim-spaces="true">
<![CDATA[{{source("HIERARCHY", "title", "def")}}]]>
</Template>
</Action>1
2
3
4
5
2
3
4
5
xml
<Action type="SET_TEXT">
<Template trim-spaces="true">
<![CDATA[{{source("CLASSIFICATION", "title", "fra")}}]]>
</Template>
</Action>1
2
3
4
5
2
3
4
5
Remove text
It is possible to automate the deletion of the value of the following fields:
IDENTIFIERSINGLE-LINE-TEXTLONG-TEXTHTML-TEXT
xml
<Action type="REMOVE_VALUE"/>1
CLASSIFICATION actions
Set a fixed category
The SET_CATEGORY action is only available within Mapping, see details here. To set a category in Formulas, use the SET_TEXT action.
The exact CATEGORY key to apply must be provided.
xml
<Action type="SET_CATEGORY">
<Value>wiredDrill</Value>
</Action>1
2
3
2
3
Map categories
It is possible to define a mapping between a source field and a target CLASSIFICATION. The following source fields are supported:
SINGLE-SELECTMULTIPLE-SELECTMULTIPLE-SELECT-QUANTIFIEDMULTIPLE-SELECT-QUANTIFIED-WITH-COMMENTSCLASSIFICATION
The source OPTION or CATEGORY key must be provided.
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"/>
</Map>
</Action>1
2
3
4
5
6
7
2
3
4
5
6
7

NUMBER actions
Set a fixed number
A valid number value must be provided. The decimals separator is .. No separator is supported. It is possible to specify the suffix by its key.
xml
<Action type="SET_NUMBER">
<Value>10.2</Value>
</Action>1
2
3
2
3
xml
<Action type="SET_NUMBER">
<Value suffix="CM">10</Value>
</Action>1
2
3
2
3
Copy a number
It is possible to copy a NUMBERfield value into another NUMBER field. It is possible to specify the precision, rounding and suffix by its key.
The following rounding methods are possible (see details here):
UPDOWNCEILINGFLOORHALF_UPHALF_DOWN
xml
<Action type="SET_NUMBER">
<Copy source="WIDTH" precision="2" round="UP" />
</Action>1
2
3
2
3
xml
<Action type="SET_NUMBER">
<Copy source="WIDTH" precision="2" round="UP" suffix="CM" />
</Action>1
2
3
2
3

Use a number template
It is possible to build up a NUMBER field value from other NUMBER fields. It is possible to specify the precision, rounding and suffix by its key.
The following rounding methods are possible (see details here):
UPDOWNCEILINGFLOORHALF_UPHALF_DOWN
It is possible to perform mathematical operation with the following operators:
*for multiplication/for division–for subtraction+for addition
TIP
If the attribute key contains a quote " , it must be doubled, example: la "composition" -> source="la ""composition""".
xml
<Action type="SET_NUMBER">
<Template precision="2" round="DOWN">
<![CDATA[{{source("price")}}-{{source("quantity")}}]]>
</Template>
</Action>1
2
3
4
5
2
3
4
5
xml
<Action type="SET_NUMBER">
<Template precision="2" round="DOWN" suffix="euro">
<![CDATA[
{{source("prixHT")}} * 19.6
]]>
</Template>
</Action>1
2
3
4
5
6
7
2
3
4
5
6
7
Remove number
It is possible to automate the deletion of a NUMBER value.
xml
<Action type="REMOVE_VALUE"/>1
SINGLE-SELECT, MULTIPLE-SELECT... actions
Set a fixed option(s)
The SET_OPTION action is only available within Mapping, see details here. To set a option in Formulas, use the SET_TEXT action.
The exact OPTION key to apply must be provided.
For SINGLE-SELECT target field, use the SET_OPTION action. For MULTIPLE-SELECT... target field, use the SET_OPTIONS action.
xml
<Action type="SET_OPTION">
<Value>wiredDrill</Value>
</Action>1
2
3
2
3
xml
<Action type="SET_OPTIONS">
<Value>HDMI</Value>
<Value>USB-C</Value>
</Action>1
2
3
4
2
3
4
xml
<Action type="SET_OPTIONS">
<Value quantity="1" comment="HDMI 3.1">HDMI</Value>
<Value quantity="2" comment="USB-C">USB</Value>
</Action>1
2
3
4
2
3
4
Map options
It is possible to define a mapping between a source field and a target SINGLE-SELECT or MULTIPLE-SELECT... field. The following source fields are supported:
SINGLE-SELECTMULTIPLE-SELECTMULTIPLE-SELECT-QUANTIFIEDMULTIPLE-SELECT-QUANTIFIED-WITH-COMMENTSCLASSIFICATION
The source OPTION or CATEGORY key must be provided.
xml
<Action type="SET_CATEGORY">
<Map source="CONNECTOR">
<Entry source="usb" target="USB"/>
<Entry source="usb-c" target="USB"/>
<Entry source="mini-hdmi" target="HDMI"/>
</Map>
</Action>1
2
3
4
5
6
7
2
3
4
5
6
7

Set selectable options
The SET_SELECTABLE_OPTIONS action allows to limit the options available to the user within the Product-Live when editing a product field. This is possible only on SINGLE-SELECT fields.
The exact OPTION key must be provided.
xml
<Action type="SET_SELECTABLE_OPTIONS">
<Value>USB-C</Value>
<Value>HDMI</Value>
<Value>DVI</Value>
</Action>1
2
3
4
5
2
3
4
5
ATTACHMENT actions
ATTACHMENT fields can only be automated within the Mapping. See details here
Copy an attachment
It is possible to copy a file from an ATTACHMENT field into another ATTACHMENT.
xml
<Action type="SET_ATTACHMENT">
<Copy source="TECHNICAL_DATA_SHEET" />
</Action>1
2
3
2
3
IMAGE actions
IMAGE fields can only be automated within the Mapping. See details here
Copy an image
It is possible to copy a file from an ATTACHMENT field into another ATTACHMENT. The attributes width-px, height-px, quality and format allows applying a transformation to an image before it is dumped.
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
DATE, DATE-TIME actions
Set a fixed date
The date and date-time value must follow the ISO 8601 format.
xml
<Action type="SET_TEXT">
<Value>2024-09-26</Value>
</Action>1
2
3
2
3
xml
<Action type="SET_TEXT">
<Value>2024-10-27T00:00:00.000Z</Value>
</Action>1
2
3
2
3
About template
The template uses a programming language Twig enabling you to concat fields and even transform and compute advanced values. The list of native functions is available here.In addition to those, the template comes with four additional functions.
| Function | Description |
|---|---|
base64_decode | It decodes a base64 encoded string into a readible string. base64_decode("e1wiZmllbGRLZXlcIjpcIkVBTlwiLFwib3BlcmF0b3JcIjpcImNvbnRhaW5zXCIsXCJjcml0ZXJpYVwiOntcInN0cmluZ1wiOlwiMjAwMDA5OTkxOTMzNVwifX0=") |
base64_encode | It encodes a readible string into an encoded base64 string that can be used in urls. base64_encode("[{\"fieldKey\":\"EAN\",\"operator\":\"contains\",\"criteria\":{\"string\":\"2000099919335\"}}]") |
loadChildren | It dynamically loads children of the source or target item enabling to access to their attributes. loadChildren(sourceItem) |
source | It allows accessing the value of a property of a source item. More details below. source("LIBELLE_ARTICLE") |
target | It allows accessing the value of a property of the current item. More details below. target("MARQUE_COMMERCIALE") |
targetItem | It allows accessing the whole item value in json format. From it you can use json path to retrieve any field value. More details below. targetItem.fields.DESCRIPTION.value.data |
TIP
When using templates, to ensure the rule is computed at source field edition, use either the
sourceortargetfunctions, or the syntaxtargetItem.fields.<Field_Key>.value.data. Other syntaxes may prevent the Rules Engine from detecting when to recompute the value.A maximum of 20 source fields are permitted.
Templates may utilize any field type; however, the value produced must be compatible with the target field’s format. For instance, assigning a date to a
NUMBERfield will result in no value being applied.You can access composite children fields in template using below syntax:
- If there is a single record in the
COMPOSITEfield:targetItem.fields.<COMPOSITE_FIELD_KEY>.<CHILD_FIELD_KEY>.value.dataexample:targetItem.fields.BATTERIES_REQUIRED.BATTERY_TYPE_CODE.value.data - If there are multiple records in the
COMPOSITEfield:targetItem.fields.<COMPOSITE_FIELD_KEY>[<Record_number>].<CHILD_FIELD_KEY>.value.data
example:targetItem.fields.TITLE[0].LOCAL_TITLE.value.data}}
Record index starts at0
- If there is a single record in the
How to use conditions?
In the examples below there is one retailer named RetailerX that share a table with a supplier named BrandX like this:

The target Products table of the retailer contains two fields :
- EAN the EAN 13 of the product
- Label the label displayed in the website
The source Products table of the supplier contains also two fields:
- EAN 13 the EAN 13 of the product
- Title the title of the product
BrandX has configured the rules engine like this:
- EAN 13 is mapped with EAN and is used to link tables
- Title is mapped with Label
Now we will see how to use the conditions.
No conditions
If there is no conditions, then if there is a value in the source table then it will update the target table. Then you will have:

But if the source value is empty, then it will erase the target value:

Important
Be aware that if you do not set conditions, values in the target will be erased if the source value is empty.
This is also true if you have updated the target field manually.
Do not erase if the source is empty
If you do not want to erase the target value when the source value is empty, then you must add this condition:

Then if the source value is empty, after the execution you will have this result:

As you can see the target value is not altered.
Do not erase if there is already a value in the target
If you need to initialize the target value and then update it manually, then you can set a condition on target:

Then it will give this result:

As you can see conditions can be used to define which behavior you want to apply. There is no global rules, it really depends on your needs.
If you do not set conditions, then it will mirror your data source.
Automate measures with their unit
If you need to automate a target field based on number field unit, you need to create a rule for each unit by setting a condition on the SUFFIX.

Condition list
WARNING
- If the specified operator does not exist, or if a parameter is missing, the condition is considered invalid and is not processed.
- In the case of the
EQUALSandNOT_EQUALSoperators, a singleValuecan be entered. If severalValueare entered, the whole condition is considered invalid and is not processed. - If a
Valuerefers toCATEGORY,OPTIONorSUFFIXthat does not exist, the whole condition is considered invalid and is not processed. - The maximum number of
Valuein aINorNOT_INcondition is1000. If the number ofValueis greater, the whole condition is considered invalid and is not processed.
IDENTIFIER, SINGLE-LINE-TEXT HTML-TEXT and LONG-TEXT conditions
WARNING
All conditions are case and accent sensitive, except CONTAINS.
| Operator | Description | Parameter Required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
CONTAINS | Contains (not case and accent sensitive) | A single string Value allowed | |
EQUALS | Strictly equal | A single string Value allowed | |
STARTS_WITH | Starts with | A single string Value allowed | |
ENDS_WITH | Ends with | A single string Value allowed | |
IN | Is equal to one of the mentioned values | Multiple string Value allowedOne string Value required at least | |
NOT_IN | Does not equal any of the mentioned values | Multiple string Value allowedOne string Value required at least |
Example:
xml
<Condition target="titleEn" operator="STARTS_WITH">
<Value>Laptop - <Value>
</Condition>1
2
3
2
3
CLASSIFICATION conditions
| Operator | Description | Parameter Required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
EQUALS | Equals the mentionned CATEGORY key. | A single CATEGORY key allowed as Value | |
NOT_EQUALS | Does not equal the mentioned CATEGORY key | A single CATEGORY key allowed as Value | |
IN | Is equal to one of the mentioned CATEGORY key | Multiple CATEGORY key allowed as ValueOne CATEGORY key required at least | |
NOT_IN | Does not equal any of the mentioned CATEGORY key | Multiple CATEGORY key allowed as ValueOne CATEGORY key required at least |
Example:
xml
<Condition target="TYPOLOGY" operator="IN">
<Value>LAPTOP<Value>
<Value>DESKTOP<Value>
</Condition>1
2
3
4
2
3
4
NUMBER conditions
WARNING
If the provided Value is not a valid number, the whole condition is considered invalid and is not processed.
| Operator | Description | Parameter Required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
LESS_THAN | Strictly inferior | A single value allowed | |
LESS_THAN_OR_EQUAL | Less than or equal | A single value allowed | |
GREATER_THAN | Strictly superior | A single value allowed | |
GREATER_THAN_OR_EQUAL | Greater than or equal | A single value allowed | |
EQUALS | Strictly equals | A single value allowed |
Example:
xml
<Condition target="price" operator="LESS_THAN">
<Value>100.4<Value>
</Condition>1
2
3
2
3
Suffixes conditions
Utilize the use attribute within the NUMBER condition to clearly indicate whether it pertains to the numeric or suffix value.
use value | Description |
|---|---|
VALUE | Default, The item numeric value. If the use attribute is not set, the default value is used |
SUFFIX_KEY | The item Suffix key. |
WARNING
- Active and archived
Suffixescan be used in the condition. - All conditions are case and accent sensitive, except
CONTAINS.
| Operator | Description | Parameter Requried | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
EQUALS | Strictly equals | A single Suffix key allowed as Value | |
NOT_EQUALS | Strictly not equals | A single Suffix key allowed as Value | |
CONTAINS | Contains (not case and accent sensitive) | A single Suffix key allowed as Value | |
STARTS_WITH | Starts with | A single Suffix key allowed as Value | |
ENDS_WITH | Ends with | A single Suffix key allowed as Value |
Example:
xml
<Condition source="PRICE" use="SUFFIX_KEY" operator="EQUALS" >
<Value>euro</Value>
</Condition>1
2
3
2
3
SINGLE-SELECT, MULTIPLE-SELECT... conditions
| Operator | Description | Parameter Required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
EQUALS | Equals the mentionned OPTION key. | A single OPTION key allowed as Value on SINGLE-SELECTMultiple OPTION key allowed as Value on MULTIPLE-SELECT... | |
NOT_EQUALS | Does not equal the mentioned OPTION key | A single OPTION key allowed as ValueMultiple OPTION key allowed as Value on MULTIPLE-SELECT... | |
IN | Is equal to one of the mentioned OPTION key | Multiple OPTION key allowed as ValueOne OPTION key required at least | |
NOT_IN | Does not equal any of the mentioned OPTION key | Multiple OPTION key allowed as ValueOne OPTION key required at least |
Example:
xml
<Condition target="color" operator="NOT_IN">
<Value>red</Value>
<Value>blue</Value>
</Condition>1
2
3
4
2
3
4
Quantity conditions
Utilize the use attribute within the NUMBER condition to clearly indicate whether it pertains to the numeric or suffix value.
use value | Description |
|---|---|
VALUE | Default, The item OPTION key.If the use attribute is not set, the default value is used |
QUANTITY | The item quantity. |
WARNING
If the provided Value is not a valid number, the whole condition is considered invalid and is not processed.
| Operator | Description | Parameter Required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
LESS_THAN | Strictly inferior | A single value allowed | |
LESS_THAN_OR_EQUAL | Less than or equal | A single value allowed | |
GREATER_THAN | Strictly superior | A single value allowed | |
GREATER_THAN_OR_EQUAL | Greater than or equal | A single value allowed | |
EQUALS | Strictly equals | A single value allowed |
Example:
xml
<Condition source="DEA" operator="LESS_THAN" use="QUANTITY">
<Value>1</Value>
</Condition>1
2
3
2
3
IMAGE, ATTACHMENT conditions
| Operator | Description | Parameter Required | Details |
|---|---|---|---|
EMPTY | Is empty | NA | |
NOT_EMPTY | Is not empty | NA |
Example:
xml
<Condition source="FRONT_IMAGE" operator="NOT_EMPTY"/>1
DATE, DATE-TIME conditions
WARNING
The provided Value must be a valid date, (see https://en.wikipedia.org/wiki/ISO_8601#Dates, the whole condition is considered invalid and is not processed.
| Operator | Description | Parameter Required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
LESS_THAN | Strictly inferior | A single value allowed | |
LESS_THAN_OR_EQUAL | Less than or equal | A single value allowed | |
GREATER_THAN | Strictly superior | A single value allowed | |
GREATER_THAN_OR_EQUAL | Greater than or equal | A single value allowed | |
EQUALS | Strictly equals | A single value allowed |
Example:
xml
<Condition target="SHIPPING_DATE" operator="LESS_THAN_OR_EQUAL">
<Value>2025-06-15T00:00:00.000Z<Value>
</Condition>1
2
3
2
3
FAQ
Can I use the rules engine on my own table?
Yes, it is possible to use the rule engine on your own tables. You have the same rules engine but for your data, and the execution of the rules asynchronous, which means that an administrator must configure the periodicity of the execution of the rules. Usually Product-Live team has configured a periodic execution done during the night. If you want to learn more contact Product-Live support.
Info
The ability to create rules on owned table is in access for a limited number of accounts and will soon be available to all users.