# 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](/files/YMdGpLxTT9jb7PsrUFGU)

## 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: 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:

```
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>
```

The question should be specific, self-contained, and written in natural language.
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.
