Task
The table has numeric stock, while the feed needs text availability: in_stock or out_of_stock.
Short answer
Create availability from stock: if the value is <= 0, replace it with out_of_stock; if it is > 0, replace it with in_stock.
How to Do It in Eofferix
- Open the settings of the output
availabilitycolumn.
The click is on the settings icon of the availabilitycolumn. - Add two rules:
less than or equal to 0→out_of_stock, thengreater than 0→in_stock.
The Transformationsblock shows the full rule chain for this case. - Save the column settings and go to the
Exportstep.
Before / After
Before
source data| sku | stock |
|---|---|
| SKU-600 | 5 |
| SKU-601 | 0 |
After
result| sku | availability |
|---|---|
| SKU-600 | in_stock |
| SKU-601 | out_of_stock |