Rules engine – Conditions
Conditions define when an action is executed. They are configured in the Only if section of a rule.
source vs target
Depending on the context, conditions can be evaluated on:
source="...": a field on the source item (in a mapping).target="...": a field on the current/target item (before applying the action).
In a pure Formula context (single table), source and target usually refer to the same item, but we recommend using source="..." in XML examples for consistency.
Condition groups (AND / OR)
Conditions are always evaluated inside groups:
- A condition group is a set of conditions linked by the operator AND.
→ All conditions in the group must be true for the group to be true. - Multiple condition groups are linked by the operator OR.
→ If at least one group is true, the whole condition is true. - Nesting condition groups is not allowed.
Examples
- One group, two conditions (AND)
titleEnmust be empty ANDlabelmust be not empty:
xml
<Conditions>
<Condition-Group>
<Condition source="titleEn" operator="EMPTY" />
<Condition source="label" operator="NOT_EMPTY" />
</Condition-Group>
</Conditions>1
2
3
4
5
6
2
3
4
5
6
- Two groups (OR)
titleEnmust be empty ANDlabelnot empty, ORdescriptionmust be not empty:(titleEn == "" && label != "") || description != ""
xml
<Conditions>
<Condition-Group>
<Condition source="titleEn" operator="EMPTY" />
<Condition source="label" operator="NOT_EMPTY" />
</Condition-Group>
<Condition-Group>
<Condition source="description" operator="NOT_EMPTY" />
</Condition-Group>
</Conditions>1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Basic behaviors
No conditions
If there is no condition, then:
- If there is a value in the source table, it will update the target table.
- If the source value is empty, it will erase the target value (even if you updated the target manually).
This behavior mirrors your source data.
Do not erase if the source is empty
If you do not want to erase the target value when the source value is empty:
- Add a condition like “Source is not empty” on the source field.
Then:
- If the source value is empty, the target value is kept as is.
Do not erase if there is already a value in the target
If you need to initialize the target value with the rules engine and then manually update it:
- Add a condition like “Target is empty” on the target field.
Then:
- The rule only applies when the target field is empty.
- If the target field already has a value, it is not overwritten.
Automate measures with their unit (suffix)
If you need to automate a target field based on a number field and its unit, you usually:
- Create one rule per unit, and
- Set a condition on the suffix (unit) of the number field.
See the section about Suffixes conditions below.
General validation rules
If a condition is invalid, it is ignored and not processed.
Examples of invalid conditions:
- The specified operator does not exist.
- A required parameter is missing.
- A
Valuerefers to aCATEGORY,OPTIONorSUFFIXthat does not exist. - For
EQUALSandNOT_EQUALS, more than oneValueis provided. - For
INorNOT_IN, more than 1000Valueentries are provided.
TEXT fields
IDENTIFIER, SINGLE-LINE-TEXT, HTML-TEXT and LONG-TEXT fields
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 allowed, at least one required | |
NOT_IN | Does not equal any of the mentioned values | Multiple string Value allowed, at least one required |
Example:
xml
<Condition source="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 mentioned CATEGORY key | A single CATEGORY key as Value | |
NOT_EQUALS | Does not equal the mentioned CATEGORY key | A single CATEGORY key as Value | |
IN | Is equal to one of the mentioned CATEGORY keys | Multiple CATEGORY keys as Value, at least one required | |
NOT_IN | Does not equal any of the mentioned CATEGORY keys | Multiple CATEGORY keys as Value, at least one required |
Example:
xml
<Condition source="TYPOLOGY" operator="IN">
<Value>LAPTOP</Value>
<Value>DESKTOP</Value>
</Condition>1
2
3
4
2
3
4
NUMBER conditions
If the provided
Valueis not a valid number, the 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 less than | A single numeric Value | |
LESS_THAN_OR_EQUAL | Less than or equal | A single numeric Value | |
GREATER_THAN | Strictly greater than | A single numeric Value | |
GREATER_THAN_OR_EQUAL | Greater than or equal | A single numeric Value | |
EQUALS | Strictly equals | A single numeric Value |
Example:
xml
<Condition source="price" operator="LESS_THAN">
<Value>100.4</Value>
</Condition>1
2
3
2
3
Suffixes conditions (units)
Use the use attribute within a NUMBER condition to specify whether the condition targets the numeric value or the suffix key.
use value | Description |
|---|---|
VALUE | Default – the numeric value (if use is not set) |
SUFFIX_KEY | The Suffix (unit) key |
Active and archived
Suffixescan be used. All conditions are case and accent sensitive, exceptCONTAINS.
Supported operators on suffix keys:
| Operator | Description | Parameter required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
EQUALS | Strictly equals | A single Suffix key as Value | |
NOT_EQUALS | Strictly not equals | A single Suffix key as Value | |
CONTAINS | Contains (not case and accent sensitive) | A single Suffix key as Value | |
STARTS_WITH | Starts with | A single Suffix key as Value | |
ENDS_WITH | Ends with | A single Suffix key as Value |
Example:
xml
<Condition source="PRICE" use="SUFFIX_KEY" operator="EQUALS">
<Value>euro</Value>
</Condition>1
2
3
2
3
SINGLE-SELECT and MULTIPLE-SELECT... conditions
| Operator | Description | Parameter required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
EQUALS | Equals the mentioned OPTION key | A single OPTION key allowed as Value on SINGLE-SELECT; multiple keys allowed on MULTIPLE-SELECT... | |
NOT_EQUALS | Does not equal the mentioned OPTION key | A single OPTION key allowed as Value; multiple keys allowed on MULTIPLE-SELECT... | |
IN | Is equal to one of the mentioned OPTION keys | Multiple OPTION keys as Value, at least one required | |
NOT_IN | Does not equal any of the mentioned OPTION keys | Multiple OPTION keys as Value, at least one required |
Example:
xml
<Condition source="color" operator="NOT_IN">
<Value>red</Value>
<Value>blue</Value>
</Condition>1
2
3
4
2
3
4
Quantity conditions
For quantified options, use the use attribute to indicate whether the condition targets the option key or the quantity.
use value | Description |
|---|---|
VALUE | Default – the OPTION key (if use is not set) |
QUANTITY | The item quantity |
If the provided
Valueis not a valid number, the condition is considered invalid and is not processed.
Supported operators on quantities:
| Operator | Description | Parameter required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A | |
LESS_THAN | Strictly less than | A single numeric Value | |
LESS_THAN_OR_EQUAL | Less than or equal | A single numeric Value | |
GREATER_THAN | Strictly greater than | A single numeric Value | |
GREATER_THAN_OR_EQUAL | Greater than or equal | A single numeric Value | |
EQUALS | Strictly equals | A single numeric Value |
Example:
xml
<Condition source="DEA" operator="LESS_THAN" use="QUANTITY">
<Value>1</Value>
</Condition>1
2
3
2
3
IMAGE and ATTACHMENT conditions
| Operator | Description | Parameter required | Details |
|---|---|---|---|
EMPTY | Is empty | N/A | |
NOT_EMPTY | Is not empty | N/A |
Example:
xml
<Condition source="FRONT_IMAGE" operator="NOT_EMPTY" />1
DATE and DATE-TIME conditions
The provided
Valuemust be a valid date in ISO 8601 format. Otherwise, the 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 earlier than | A single date Value | |
LESS_THAN_OR_EQUAL | Earlier than or equal | A single date Value | |
GREATER_THAN | Strictly later than | A single date Value | |
GREATER_THAN_OR_EQUAL | Later than or equal | A single date Value | |
EQUALS | Strictly equals | A single date Value |
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