> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/hierarchical-json-input/example-hierarchical-json-input.md).

# Examples

The following data is example JSON data in a file that you can load into PDI:

```
{
     "employees": [
           {
                    "name" : "emp_name_1" ,
                    "age" : 35,
                    "addresses" :[
                           {
                                  "country":"Country_1"
                           },
                           {
                                  "country":"Country_2"
                           }
                    ]
           },
           {
                    "name" : "emp_name_2",
                    "age" : 35,
                    "addresses" :[
                           {
                                  "country" :"Country_3"
                            },
                            {
                                  "country" :"Country_4"
                            {
                    ]
           }
     ]
}
```

## Example 1

The following data is extracted from this JSON file when you specify the **Split rows across path** option as `$.employees[*]` and do not specify any filters:

![Hierarchical JSON Input step example output](https://2745965000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvZoINBz5C5WnDZQlbOJQ%2Fuploads%2Fgit-blob-27023896aa6a540b2dafe40993a12d593edb0b18%2FPDI%20Heirachical%20JSON%20input%20step%20example%20data.png?alt=media)

## Example 2

if you configure the step with an example split path of `$.employees[*]`, and are only interested in the name and age, use the filters of `$.name` and `$.age` on the **Filters** tab. This produces two rows on the stream of the Hierarchical JSON Input step:

Row 1

```
 {
                    "name" : "emp_name_1" ,
                    "age" : 35
           }

```

Row 2

```
{
                    "name" : "emp_name_2",
                    "age" : 35
           }

```

## Example 3

If you wanted a filtered entry in a single HDT row, leave the **Split rows across path** field blank, and use the filter paths

```
$.employees[*].name
$.employees[*].age

```

This will result in a single row with one HDT that does not have the input split as follows:

```
{
     "employees": [
           {
                    "name" : "emp_name_1" ,
                    "age" : 35
           },
           {
                    "name" : "emp_name_2",
                    "age" : 35
           }
     ]
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/hierarchical-json-input/example-hierarchical-json-input.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
