Conditions in transformations: when a rule runs

How rule conditions work: any, equals, greater than, contains substring, empty, regular expression, and checks against other nodes or columns.

A condition in a transformation answers one question: should this rule run now, or should Eofferix skip it and continue with the next rule? For example: if the price is greater than 100, add markup; if the SKU is not empty, add a prefix; if the value contains USD, remove that substring.

The same checks can appear in transformations and in export conditions, but the result is different. A transformation changes a field value. An export condition decides whether a field, row, product, or XML/JSON element appears in the output file.

Where The Condition Is Used

In a transformation row, the condition sits between the value source and the action. Eofferix first takes the value from the selected source, checks the condition, and only then runs the action.

  • Source - the current value or another node, attribute, column, or system value.
  • Condition - the check: any, equals, greater than, contains substring, empty, regular expression, and other options.
  • Condition value - the value used for comparison. Conditions such as "any", "empty", and "not empty" do not need it.
  • Action - what to do when the condition is true: replace, remove spaces, increase by percent, do not load the field, and so on.

A condition does not have to use the current field. For example, an Availability value can be changed based on the neighboring stock node, and a price can be changed based on currency or an activity flag.

Before Or After Transformations

Inside a transformation chain, rules run from top to bottom. Each next row receives the result of the previous row. If you need to clean a price from spaces and currency first and then check it as a number, place the cleanup rules above the numeric condition.

Condition Reference

The reference keeps only the useful columns: condition name, when to use it, and how it behaves. A separate Example column is not needed here because practical scenarios are shown below.

ConditionWhen to useBehavior
anyThe rule should always run.Matches any value, including an empty one.
equalsYou need an exact match.Compares the whole value. Letter case matters only when case sensitivity is enabled.
not equalYou need to process all values except one.Matches when the value differs from the specified value.
greater thanYou need to check a number: price, weight, stock, quantity.Both sides of the comparison are read as numbers.
less thanYou need to find values below a threshold.Works as a numeric check.
greater than or equal toThe threshold itself should also match.Matches a value that is equal to or above the threshold.
less than or equal toThe threshold itself should also match.Matches a value that is equal to or below the threshold.
contains substringYou need to find a fragment inside text.Matches when the specified text is found anywhere in the value.
does not contain substringYou need to exclude values with a specific word, code, or fragment.Matches when the specified text is not present in the value.
starts withThe first part of the value matters.Matches when the value starts with the specified text.
ends withThe last part of the value matters.Matches when the value ends with the specified text.
emptyYou need to handle empty fields.A string containing only spaces is treated as empty.
not emptyThe action is needed only for filled values.Matches when something remains after trimming spaces around the value.
regular expressionYou need to check the value by a pattern.Matches when the regular expression finds a match.
not regular expressionYou need to process values that do not match a pattern.Matches when the regular expression does not find a match.

Practical Example

Below is one source XML fragment and two different configuration variants. The first prepares a price; the second creates an availability value from the neighboring stock node.

<catalog>
  <product>
    <name>Nordic Desk</name>
    <sku>SKU-110</sku>
    <price>12 490 USD</price>
    <stock>8</stock>
  </product>
</catalog>
XML snapshot with source product, price, and stock values
The snapshot shows a short version of the source XML and the values that can be used in transformations.

Variant 1: Prepare The Price

The price arrives as text: 12 490 USD. To get a number, the rules run in sequence: first clean the value, then check the prepared number.

  1. Condition any: remove spaces from the current value.
  2. Condition contains substring with value USD: replace the substring with an empty value.
  3. Condition greater than with value 100: increase the price by 10%.
Price transformation window with any, contains substring, and greater than conditions
Each row receives the result of the previous row, so the numeric condition runs after price cleanup.
BeforeRules That RunAfter
12 490 USDremove spaces, remove USD, increase by 10%13739

Variant 2: Create Availability From Stock

Availability can be filled not from its current value, but from the neighboring stock node. This is useful when the output needs a text status while the source contains only a quantity.

  1. First, a rule with condition any sets the base value to in_stock.
  2. The next rule checks {/catalog/product/stock}. If stock is less than or equal to 0, the value is replaced with out_of_stock.
Availability transformation window with a condition based on the neighboring stock node
The condition source can differ from the field being transformed.
Source StockAvailability Result
8in_stock
0out_of_stock

What To Remember

  • For numeric conditions, first remove currency, spaces, units, and other text.
  • For "contains substring", "starts with", and "ends with", the search value must not be empty.
  • If you need to remove the whole product, row, or XML/JSON element, use export conditions instead of only transforming one field.
  • If a rule did not run, check the row order: the required cleanup may need to happen earlier.