Articles on: Frequently Asked Questions (FAQ)

How do I configure XML parent and variant nodes?

JMESPath and Liquid let you extract data from JSON and XML feeds. This guide explains how to set the Parent Node and Variant Node in Feed Manager (Step 1), which helps when variant data is nested or stored separately.


To map the XML node in Step 2, see How to map XML v2.



What Are JMESPath and Liquid?


  • JMESPath is a query language for JSON that lets you filter, select, and transform feed data. Learn more at jmespath.org.
  • Liquid is a templating language for referencing dynamic values, such as Shopify's {{product.id}}. Learn more in the Shopify Liquid Reference.



How to Set Up the Parent Node and Variant Node


  1. Open Feed Manager: Go to App → Feed Settings → Step 1: Feed Manager.
  2. Set the Parent Node: Enter the path to the list of products, such as products or root.products[*].product.
  3. Set the Variant Node: Enter the path to the variants, such as variant.{title: [].title | [0], price: [].price | [0]}.
  4. Map the fields in Step 2: Go to Step 2: Matching Column and map each field to the matching node value.


Set the variant node only when your variant data is nested. Otherwise, leave it empty.



JMESPath Examples


1. Basic Expressions

Use a key name to select a value, such as "b" in a JSON object.

Basic expression selecting the "b" value


To extract a nested value, such as "value" inside an object:

Nested value expression


Index expressions select an element from a list, like array access in common programming languages. Indexing starts at 0.

Index expression


To select an element from a list of two elements separated by another element:

Index expression for a list of two elements


2. Slicing

Slicing extracts part of a list by setting a start and end index. For example, slicing from index 0 to 3 returns the first three elements.

Slicing from index 0 to 3


If the start or end index is omitted, the slice starts at the beginning or ends at the end of the list. The image below shows an end index that returns 5 elements.

Slicing with an omitted start index


To return only the even-numbered elements:

Even-numbered elements


3. Parent Node With Nested Variants (JSON)

In this example, each product has a variants list.


{
  "products": [
    {
      "title": "T-Shirt",
      "stock_sync_variant_title": "Apparel",
      "variants": [
        { "title": "red-small-cotton", "quantity": 3 },
        { "title": "blue-medium-cotton", "quantity": 4 }
      ]
    },
    {
      "title": "Jeans",
      "stock_sync_variant_title": "Apparel",
      "variants": [
        { "title": "red-small-cotton", "quantity": 3 },
        { "title": "blue-medium-cotton", "quantity": 4 }
      ]
    },
    {
      "title": "Sweater",
      "stock_sync_variant_title": "Apparel",
      "variants": [
        { "title": "red-small-cotton", "quantity": 3 },
        { "title": "blue-medium-cotton", "quantity": 4 }
      ]
    }
  ]
}


  • To retrieve all products, use products as the parent node.

Parent node set to products


  • To retrieve only the first two products, use products[:2] as the parent node.

Parent node set to products[:2]


  • To retrieve products starting from the second one, use products[1:] as the parent node.

Parent node set to products[1:]


4. Parent Node in XML Products Data

In this example, the products are inside root.products, and each product is wrapped in a product object.


  • To retrieve the product list, use root.products[1:].product or root.products[*].product as the parent node.

Parent node for XML products


5. Variant Node Settings

Use the variant node to pick specific values from a variant list.


{
  "variant": [
    { "title": "Raidė" },
    { "id": "5" },
    { "price": "0.0000" },
    { "price_prefix": "+" },
    { "value_title": "A" },
    { "quantity": "16" },
    { "code": "BN82232" },
    { "barcode": "4019359822320" },
    { "weight": { "prefix": "+", "measures": "kg.", "weight": "0.00000000" } }
  ]
}


  • To get the variant list with specific values, set the variant node as variant.{title: [].title | [0], id: [].id | [0], price: [].price | [0], quantity: [].quantity | [0], weight: [].weight | [0]}.

Variant node example

  • If you define only the variant node itself, all sections are included.
  • If you do not set the variant node, map each value by its index instead, such as {{data.variant[3]}} for the price.
  • When you set the variant node, you can map the price directly as price.


6. XML Records With Different Node Names

For XML records, use the record name as the parent node, such as "data-set"[].record.


  • If the products repeat under keys with different names, such as item_0 and item_1, use the values() function to read them all: values(root.some_path).



Key Rules & Technical Details


  • Indexing starts at 0: The first item in a list is [0], the second is [1], and so on.
  • Parent node must point to a list: Use products or root.products[*].product, so Stock Sync reads each product as a separate row.
  • Variant node is optional: Set it only when variant data is nested inside each product.



Troubleshooting Steps


  • Issue: Products are not imported or the wrong products are read → Solution: Check the parent node path and confirm it points to the list of products, such as products[*].
  • Issue: Variant values are missing or mixed up → Solution: Check the variant node and confirm each variant field uses [].field | [0].
  • Issue: Values from a list are not picked up → Solution: Use the index that matches the position of the value in the list, starting from [0].



Good Articles to Continue


Updated on: 13/11/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!