> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.pdfgeneratorapi.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to create Nested Array (Multidimensional Array)?

Nested Array is a wide-spread method to iterate an array inside another array. If you want to create a nested array you need to place a Container Component (or Table Component) inside another Container Component where one of them would have data field of the main array and the one inside would have nested array data.

**The Outer Array (Container Component)**
In this case The Outer Array represents different Orders and it is necessary to set the Container's data field to Orders (type Array). 
![Outer Array](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/outerarray_nzj8jk.png)
**The Inner Array (Table Component)**
![Inner Array](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/innerarray_nj1z77.png)

The Inner Array represents different Line_Items in corresponding Orders. In this case we have used a Table Component to represent the Inner Array. (it is possible to use a Container Component as well). It is also necessary to set the Table's data fields to Line_Items as you can see in the picture.

**Preview**
![Preview](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/preview_xd7gby.png)
As you can see in the preview there were generated two different orders with corresponding line_items listed in the Table Component.

###### Example JSON
```
{
  "ORDERS": [
    {
      "OrderNumber": "ORDER #1",
      "LINE_ITEMS": [
        {
          "Name and Description": "DB Architecture",
          "Quantity": 1,
          "Unit Price": 840,
          "Total": 840
        },
        {
          "Name and Description": "Computer Hardware",
          "Quantity": 3,
          "Unit Price": 310,
          "Total": 930
        },
        {
          "Name and Description": "Software",
          "Quantity": 2,
          "Unit Price": 250,
          "Total": 500
        }
      ]
    },
    {
      "OrderNumber": "ORDER #2",
      "LINE_ITEMS": [
        {
          "Name and Description": "DB Analysis",
          "Quantity": 1,
          "Unit Price": 1050,
          "Total": 1050
        },
        {
          "Name and Description": "Patch Cords",
          "Quantity": 20,
          "Unit Price": 12,
          "Total": 240
        }
      ]
    }
  ]
}
```

---
### Related articles you may find helpful

* [Functions](https://support.pdfgeneratorapi.com/en/article/functions-srekaa/)
* [List (array) functions](https://support.pdfgeneratorapi.com/en/article/list-array-functions-1xlxhsw/)
* [Which fonts, languages and characters are supported?](https://support.pdfgeneratorapi.com/en/article/which-fonts-languages-and-characters-are-supported-meo2d7/)
