A transformation condition determines whether a particular rule runs. Eofferix first reads the selected source, checks the condition and, when it matches, applies the action to the field whose settings are open.
Rules run from top to bottom. Therefore, Current value in the second row is already the result of the first row; it is not necessarily the original value from the file.
Current value and a source value
| Selected at the start of the rule | Value being checked | Value being changed |
|---|---|---|
| Current value | The working result at this point in the chain, including earlier rules. | The field whose settings are open. |
A source column or node, such as stock
|
That column or node in the original record. | Still the field whose settings are open, not the selected source. |
This lets you check the source stock and write a text status to another field. The names stock and availability below are only an example; your columns and nodes may have different names.
Example: convert stock to a status
- Open Transformations for the output field
availability, which receives its source value fromstock. - Add the first rule: Current value → Any → Replace with →
in_stock. This sets the default value. - Add the second rule below it. At the start of the rule, select the source column or node
stock, then set Less than or equal →0→ Replace with →out_of_stock. The condition reads the source stock, while the action replaces the current value ofavailability.
The source stockis outlined in red in the second rule: the condition checks the original stock, not the valuein_stockset by the first rule. - Click Save. Run a small test export and check the downloaded file; use the preview as an additional check.
Result
Source stock
|
After the first rule | Final availability
|
|---|---|---|
-1
|
in_stock
|
out_of_stock
|
0
|
in_stock
|
out_of_stock
|
5
|
in_stock
|
in_stock
|
If the second rule is left on Current value, Eofferix compares the string in_stock with zero. That rule does not inspect the source stock and cannot correctly distinguish 0 from 5.
Selecting the source in the three editors
| Editor | What to select in the second rule |
|---|---|
| Table | The source column stock. |
| JSON | The stock node; in the tested example, its path is {/rows/stock}. |
| XML | The stock node; in the tested example, its path is {/workbook/sheet/row/stock}. |
Paths depend on the structure of your file. Select your stock node from the same repeating record instead of copying the example path literally.
Main conditions
| Operator | When to use | Usage example |
|---|---|---|
| Any | The action must run regardless of the value’s contents. | Trim spaces at the edges of every value. |
| Equals | Check an exact text match with a specified value. | If status equals inactive, replace it with No. |
| Not equal | Process every value except the specified one. | Add SKU- to every code except unknown. |
| Contains substring | Find a fragment anywhere in the text. | Remove USD from 1200 USD. |
| Does not contain substring | Run the action when the fragment is absent. | Add https:// if the link does not contain http. |
| Empty | Handle an empty value or a string made only of spaces. | Replace an empty field with No data. |
| Not empty | Handle only values that contain data. | Trim spaces at the edges only for filled values. |
| Greater than | Compare a number with a threshold without including the threshold. | If the price is greater than 1000, increase it by 5%. |
| Less than | Find numbers below a threshold. | If stock is less than 5, replace it with Low. |
| Greater than or equal | Include the threshold and all higher values. | Apply the rule when quantity is 10 or more. |
| Less than or equal | Include the threshold and all lower values. | Replace a price of 0 or less with Check. |
| Is between | Check whether a number is between two included endpoints. | Enter 591,5-1032.8 in one field and process prices within that range. |
| Starts with | The fragment at the beginning of the value matters. | Remove SKU- from SKU-123. |
| Ends with | The fragment at the end of the value matters. | Remove .00 from the price 125.00. |
| Regular expression | Check the value against a pattern. | Process only eight-digit codes with ^\d{8}$. |
| Not a regular expression | Process values that do not match a pattern. | Clear the value if it does not match ^\d{8}$. |
For Greater than, Less than, Greater than or equal, Less than or equal, and Is between, a decimal fraction may use a dot or a comma: both 12.5 and 12,5 take part in numeric comparisons correctly. This was verified in the table, JSON, and XML editors. Equals and Not equal compare exact text, so a dot and a comma are different for those conditions.
For Is between, enter both endpoints in one field separated by a hyphen: 58-590 or 591,5-1032.8. Both endpoints are included. The lower endpoint must come first; a malformed or reversed range does not match.
Important
- Use a numeric condition only for a value that Eofferix can read as a number. Handle empty or textual stock values with a separate rule.
- A transformation changes a field value. To omit a field or a whole record from the output, use the separate Export conditions section.
- The demonstrated result was verified in the table, JSON and XML editors.