How to Skip Products with Zero Price or Empty Stock

A practical export condition setup: clean the price, check price and stock, and exclude the whole product from the result.

This example shows how to exclude a product from the result when the cleaned price is not greater than zero or the stock value is empty. The setup is done in value settings with transformations and the Export conditions block.

The example below uses an XML source, but the same logic applies to JSON and tables: only the field path or column name changes.

Input File Example

The source can be XML, JSON, or a table. The snapshot must contain the price and stock values used for the decision.

XML

<catalog>
  <product>
    <sku>DESK-01</sku>
    <name>Nordic desk</name>
    <price>249 USD</price>
    <stock>8</stock>
  </product>
  <product>
    <sku>CHAIR-02</sku>
    <name>Loft armchair</name>
    <price>0 USD</price>
    <stock></stock>
  </product>
</catalog>

JSON

{
  "items": [
    {"sku": "DESK-01", "name": "Nordic desk", "price": "249 USD", "stock": "8"},
    {"sku": "CHAIR-02", "name": "Loft armchair", "price": "0 USD", "stock": ""}
  ]
}

Table

skunamepricestock
DESK-01Nordic desk249 USD8
CHAIR-02Loft armchair0 USD

Where to Open the Price in the Snapshot

First open the settings of the price field. The click target depends on the snapshot type.

In an XML snapshot, click the value inside the price node.

Animation showing an XML snapshot: open price settings, add a before-transformations not-empty export condition, and save
In XML, click the value to open settings, then add a condition that checks the value is not empty before transformations.

In a JSON snapshot, click the price value inside the product object.

Animation showing a JSON snapshot: open price settings, add a before-transformations not-empty export condition, and save
In JSON, settings open from the value, then the same before-transformations condition is added.

In a table snapshot, open settings with the button in the price column header.

Animation showing a table snapshot: open the price column, add a before-transformations not-empty export condition, and save
In tables, open the column settings button and add the condition in the same settings window.

Clean the Price Value

If the supplier sends the price as text with spaces and a currency code, first convert it to a number. This example uses two sequential rules.

  1. Current value - any - remove spaces.
  2. Current value - contains substring USD - remove substring.
Price transformations: remove spaces and remove the USD substring
After cleanup, the export condition checks the prepared numeric value.
BeforeAfter removing spacesAfter removing USD
249 USD249USD249
0 USD0USD0

Configure Export Conditions

To exclude the product, select the Condition for the whole item scope. When the conditions are not met, the whole product is removed from the result, not only the price field.

  1. Add a condition: price path - after transformations - greater than - 0.
  2. Add a condition: stock path - after transformations - not empty.
  3. Save the value settings.
Whole-item export conditions: price after transformations is greater than zero and stock is not empty
Both conditions must be true for the product to remain in the final export.

Result

skupricestockResult
DESK-01249 USD8The product is exported.
CHAIR-020 USDThe product is not exported.

If products with zero stock must also be excluded, replace the stock check not empty with greater than 0.