---
title: "How to extract JSON nested data using Advanced Table Viewer macro"
canonical: "https://support.appfire.com/space/TBL/3315663358/How%20to%20extract%20JSON%20nested%20data%20using%20Advanced%20Table%20Viewer%20macro"
format: markdown
---
> Macro (aura-html)

## Overview

This page guides you through using the **Advanced Table Viewer** macro to connect a JSON data source and extract nested inventory data into a simple table on your Confluence page.

## Insert the macro and configure the JSON data source

1. Insert the macro in a Confluence page using the macro shortcut (/).
2. Type `/Advanced` and select **Advanced Table Viewer**.
3. Click **Connect Data Source**.
4. From the **Select data connector** dropdown, select *JSON*. Under the **Choose data source type**, select **Upload file**.
5. Click **Browse** and select the JSON inventory file.
6. Once you choose the file, the **Row data path** field appears.

**Row data path**: Enter the JSON data path to import data and generate a table.

- The path can be a dot-separated path to the target field in the JSON string. The path is case sensitive.
- If fields along the specified row data path contain multiple values (arrays or objects), the macro cannot parse or display the data. To successfully extract data, the Row data path must navigate strictly through single-value parent objects or explicit array indexes (e.g., `[0]`) until it reaches the final target array.
- For more information, refer to <u>[JSON path syntax](https://goessner.net/articles/JsonPath/)</u>.

> 📝 Fields with multiple values (arrays or objects) are not supported to keep the table simple and sortable.

### Configure the Row data path

Expand to view the JSON path architecture of the Inventory source file used for the scenarios below.

<details>
<summary>The Inventory file JSON path architecture</summary>

▲ Root Object: inventory  
  └── 📄 Field: sheet ("Product Inventory")  
  └── 📂 Array: categories (Cannot pass as a wildcard!)  
        ├── 📦 Object: categories[0] (Hardware)  
        │     └── 📂 Array: subcategories  
        │           ├── 📦 Object: subcategories[0] (Processors_and_Memory)  
        │                 └── 📋 Array: products  ◄── [TARGET SCALAR DATA]  
        │           └── 📦 Object: subcategories[1] (Storage)  
        │                 └── 📋 Array: products  
        └── 📦 Object: categories[1] (Networking)  
              └── 📂 Array: subcategories  
                    └── 📦 Object: subcategories[0] (Infrastructure)  
                          └── 📋 Array: products
</details>

<details>
<summary>Download the JSON file used for the scenarios</summary>


</details>

## Scenarios

> Macro (refined-tabs)
> 
> > Macro (refined-tab)
> 
> This scenario demonstrates how to use the recursive descent operator (`..`) to generate a table with grouped row nesting.
> 
> - **Row data path**: inventory.categories..
> - **Select columns**: Once you specify the **Row data path**, the **Select columns **field displays the list of field names available at the specified path. You can remove, select, and reorder the column names as needed.
> - Click **Save**. The macro opens in setup mode, displaying the table with the selected column names and data.
> - To configure various features in setup mode, refer to [Set up the Advanced Table Viewer macro features](https://appfire.atlassian.net/wiki/spaces/TBL/pages/1765147138).
> - To apply the configurations, click **Save,** and the configured table appears on the Confluence page in edit and view mode.
> 
> > Macro (refined-tab)
> 
> This scenario demonstrates how to fetch a high-level list of all primary categories from the root of your JSON.
> 
> - **Row data path**: inventory.categories
> - **Select columns**: Once you specify the **Row data path**, the **Select columns **field displays the list of field names available at the specified path. You can remove, select, and reorder the column names as needed.
> 
> - Click **Save**. The macro opens in setup mode, displaying the table with the selected column names and data.
> - To configure various features in setup mode, refer to [Set up the Advanced Table Viewer macro features](https://appfire.atlassian.net/wiki/spaces/TBL/pages/1765147138).
> - To apply the configurations, click **Save,** and the configured table appears on the Confluence page in edit and view mode.
> 
> > Macro (refined-tab)
> 
> This scenario demonstrates how to use bracket-index notation to extract core hardware component data.
> 
> - **Row data path**: inventory.categories[0].subcategories[0].products
> - **Select columns**: Once you specify the **Row data path**, the **Select columns **field displays the list of field names available at the specified path. You can remove, select, and reorder the column names as needed.
> 
> - Click **Save**. The macro opens in setup mode, displaying the table with the selected column names and data.
> - To configure various features in setup mode, refer to [Set up the Advanced Table Viewer macro features](https://appfire.atlassian.net/wiki/spaces/TBL/pages/1765147138).
> - To apply the configurations, click **Save**, and the configured table appears on the Confluence page in edit and view mode.
> 
> ## More examples
> 
> Similarly, you can extract the data for specific categories. The table below lists the specific category scenarios.
> 
> | **Specific category scenarios** | **Row data path syntax** | **Output screen in setup mode** |
> | --- | --- | --- |
> | Network Infrastructure | inventory.categories[1].subcategories[0].products | ![ATV_JSON_Network Infrastructure.jpg](media://596e0b87-1076-471a-ad32-e72a617996d8) |
> | Displays and Audio | inventory.categories[2].subcategories[1].products | ![ATV_JSON_Displays and Audio.jpg](media://c4b42ef3-6601-416e-baed-a25bc16c6190) |
> | Software Security | inventory.categories[3].subcategories[1].products | ![ATV_JSON Source_Software security.jpg](media://b7da07dd-4423-4e94-9d04-8ccf482f861b) |
> | Wireless and cabling | inventory.categories[1].subcategories[1].products | ![ATV_JSON Source_Extract wireless and cabling products.jpg](media://9c8369a2-c658-4c05-a90e-978d1f03899a) |