# List the children of a generic object

List the children of a generic object by performing one of the following:

* Get the layout of the parent object by using the [GetLayout method](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/EngineJSONAPI/Content/service-genericobject-getlayout.htm).
* Get information about the children of the parent object by using the method [GetChildInfos method](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/EngineJSONAPI/Content/service-genericobject-getchildinfos.htm).

A child object is a generic object that is contained in a parent object (the handle used for the creation of the child object is the handle of the parent object).

In the parent object should be defined:

* qChildListDef in order to list the children. For more information, see *ChildListDef*.

## Examples

Example 1:

[](https://help.qlik.com/en-US/sense-developer/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/CreateVisualizations/list-childs-in-generic-object.htm)

#### The goal of this example is to create a sheet, add children to the sheet, and then get the layout of the sheet.

1. Create a sheet.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "CreateObject",
  "handle": 1,
  "params": [
    {
      "title": "Sheet 1",
      "description": "Description of sheet 1",
      "qInfo": {
        "qId": "SH01",
        "qType": "sheet"
      },
      "qChildListDef": {
        "qData": {
          "title": "/title",
          "description": "/description",
          "meta": "/meta",
          "order": "/order",
          "type": "/qInfo/qType",
          "id": "/qInfo/qId",
          "lb": "/qListObjectDef",
          "hc": "/qHyperCubeDef"
        }
      }
    }
  ]
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "qReturn": {
      "qType": "GenericObject",
      "qHandle": 2
    },
    "qInfo": {
      "qId": "SH01",
      "qType": "sheet"
    }
  },
  "change": [
    2
  ]
}
```

The sheet is created. The handle is 2.

2. Create a list object LB01.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "CreateChild",
  "handle": 2,
  "params": [
    {
      "qInfo": {
        "qId": "LB01",
        "qType": "ListObject"
      },
      "qListObjectDef": {
        "qStateName": "$",
        "qLibraryId": "",
        "qDef": {
          "qFieldDefs": [
            "Country"
          ],
          "qFieldLabels": [
            "Country Label"
          ],
          "qSortCriterias": [
            {
              "qSortByLoadOrder": 1
            }
          ]
        },
        "qInitialDataFetch": [
          {
            "qTop": 0,
            "qHeight": 1,
            "qLeft": 0,
            "qWidth": 1
          }
        ]
      },
      "title": "Listbox LB01 title",
      "description": "Listbox LB01 description"
    }
  ]
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "qReturn": {
      "qType": "GenericObject",
      "qHandle": 3
    },
    "qInfo": {
      "qId": "LB01",
      "qType": "ListObject"
    }
  },
  "change": [
    3
  ]
}
```

The list object LB01 is created.

3. Create a list object LB02.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "CreateChild",
  "handle": 2,
  "params": [
    {
      "qInfo": {
        "qId": "LB02",
        "qType": "ListObject"
      },
      "qListObjectDef": {
        "qStateName": "$",
        "qLibraryId": "",
        "qDef": {
          "qFieldDefs": [
            "City"
          ],
          "qFieldLabels": [
            "City label"
          ],
          "qSortCriterias": [
            {
              "qSortByLoadOrder": 1
            }
          ]
        },
        "qInitialDataFetch": [
          {
            "qTop": 0,
            "qHeight": 1,
            "qLeft": 0,
            "qWidth": 1
          }
        ]
      },
      "title": "Listbox LB02 title",
      "description": "Listbox LB02 description"
    }
  ]
}
```

The engine returns:

{ "jsonrpc": "2.0", "id": 3, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 4 }, "qInfo": { "qId": "LB02", "qType": "ListObject" } }, "change": [ 4 ] }

The list object LB02 is created. Its handle is 4.

4. Get the layout of the sheet (handle is 2).

The client sends:

{ "jsonrpc": "2.0", "id": 4, "method": "GetLayout", "handle": 2, "params": [] }

The engine returns:

{ "jsonrpc": "2.0", "id": 5, "result": { "qLayout": { "qInfo": { "qId": "SH01", "qType": "sheet" }, "qSelectionInfo": {}, "title": "Sheet 1", "description": "Description of sheet 1", "qChildList": { "qItems": [ { "qInfo": { "qId": "LB01", "qType": "ListObject" }, "qData": { "qListObject": { "qStateName": "$", "qSize": { "qcx": 1, "qcy": 22 }, "qDimensionInfo": { "qFallbackTitle": "Country Label", "qApprMaxGlyphCount": 14, "qCardinal": 22, "qSortIndicator": "A", "qGroupFallbackTitles": [ "Country Label" ], "qGroupPos": 0, "qStateCounts": { "qLocked": 0, "qSelected": 0, "qOption": 22, "qDeselected": 0, "qAlternative": 0, "qExcluded": 0, "qSelectedExcluded": 0, "qLockedExcluded": 0 }, "qTags": [ "$ascii", "$text" ], "qDimensionType": "D", "qGrouping": "N", "qNumFormat": { "qType": "R", "qnDec": 14, "qUseThou": 1, "qFmt": "##############", "qDec": ".", "qThou": "," }, "qIsAutoFormat": true, "qGroupFieldDefs": [ "Country" ] }, "qExpressions": [], "qDataPages": [ { "qMatrix": [ [ { "qText": "United States", "qNum": "NaN", "qElemNumber": 0, "qState": "O" } ] ], "qTails": [], "qArea": { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 1 } } ] }, "title": "Listbox LB01 title", "description": "Listbox LB01 description", "meta": "", "order": "", "id": "", "type": "", "lb": { "qStateName": "$", "qDef": { "qGrouping": "N", "qFieldDefs": [ "Country" ], "qFieldLabels": [ "Country Label" ], "qSortCriterias": [ { "qSortByLoadOrder": 1, "qExpression": {} } ], "qNumberPresentations": [], "qActiveField": 0 }, "qFrequencyMode": "N", "qInitialDataFetch": [ { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 1 } ], "qExpressions": [] }, "hc": "" } }, { "qInfo": { "qId": "LB02", "qType": "ListObject" }, "qData": { "qListObject": { "qStateName": "$", "qSize": { "qcx": 1, "qcy": 7532 }, "qDimensionInfo": { "qFallbackTitle": "City label", "qApprMaxGlyphCount": 30, "qCardinal": 7532, "qSortIndicator": "A", "qGroupFallbackTitles": [ "City label" ], "qGroupPos": 0, "qStateCounts": { "qLocked": 0, "qSelected": 0, "qOption": 7532, "qDeselected": 0, "qAlternative": 0, "qExcluded": 0, "qSelectedExcluded": 0, "qLockedExcluded": 0 }, "qTags": [ "$text" ], "qDimensionType": "D", "qGrouping": "N", "qNumFormat": { "qType": "R", "qnDec": 14, "qUseThou": 1, "qFmt": "##############", "qDec": ".", "qThou": "," }, "qIsAutoFormat": true, "qGroupFieldDefs": [ "City" ] }, "qExpressions": [], "qDataPages": [ { "qMatrix": [ [ { "qText": "Addison", "qNum": "NaN", "qElemNumber": 0, "qState": "O" } ] ], "qTails": [], "qArea": { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 1 } } ] }, "title": "Listbox LB02 title", "description": "Listbox LB02 description", "meta": "", "order": "", "id": "", "type": "", "lb": { "qStateName": "$", "qDef": { "qGrouping": "N", "qFieldDefs": [ "City" ], "qFieldLabels": [ "City label" ], "qSortCriterias": [ { "qSortByLoadOrder": 1, "qExpression": {} } ], "qNumberPresentations": [], "qActiveField": 0 }, "qFrequencyMode": "N", "qInitialDataFetch": [ { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 1 } ], "qExpressions": [] }, "hc": "" } } ] } } } }

The children LB01 and LB02 of the sheet SH01 are displayed.

Example 2:

[](https://help.qlik.com/en-US/sense-developer/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/CreateVisualizations/list-childs-in-generic-object.htm)

#### The goal of this example is to create a story and some slides inside the story and to get the layout of the story.

1. Create a story story01.

The client sends:

{ "jsonrpc": "2.0", "id": 1, "method": "CreateObject", "handle": 1, "params": [ { "title": "A Story", "description": "This is the story", "qInfo": { "qId": "story01", "qType": "story" }, "qChildListDef": { "qData": { "title": "/title", "description": "/description", "children": "/qChildListDef" } } } ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 1, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 2 }, "qInfo": { "qId": "story01", "qType": "story" } }, "change": [ 2 ] }

The story is created. The handle is 2. Since the story definition contains qChildListDef, a GetLayout on the story will display the children of the story.

2. Create a slide slide01 (qId is slide01).

The client sends:

{ "jsonrpc": "2.0", "id": 2, "method": "CreateChild", "handle": 2, "params": [ { "title": "Slide 01", "description": "This is the slide 01", "qInfo": { "qId": "slide01", "qType": "slide" }, "qChildListDef": { "qData": { "title": "/title" } } } ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 2, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 3 }, "qInfo": { "qId": "slide01", "qType": "slide" } }, "change": [ 3 ] }

The slide slide01 is created. Its handle is 3.

3. Create another slide slide02 (qId is slide02).

The client sends:

{ "jsonrpc": "2.0", "id": 3, "method": "CreateChild", "handle": 2, "params": [ { "title": "Slide 02", "description": "This is the slide 02", "qInfo": { "qId": "slide02", "qType": "slide" }, "qChildListDef": { "qData": { "title": "/title" } } } ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 3, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 4 }, "qInfo": { "qId": "slide02", "qType": "slide" } }, "change": [ 4 ] }

The slide slide02 is created. Its handle is 4.

4. Get the layout of the story. The handle of the request is 2 because the handle of the story is 2.

The client sends:

{ "jsonrpc": "2.0", "id": 4, "method": "GetLayout", "handle": 2, "params": [] }

The engine returns:

{ "jsonrpc": "2.0", "id": 4, "result": { "qLayout": { "qInfo": { "qId": "story01", "qType": "story" }, "qMeta": {}, "qSelectionInfo": {}, "title": "A Story", "description": "This is the story", "qChildList": { "qItems": [ { "qInfo": { "qId": "slide01", "qType": "slide" }, "qMeta": {}, "qData": { "title": "Slide 01", "description": "This is the slide 01", "children": { "qData": { "title": "/title" } } } }, { "qInfo": { "qId": "slide02", "qType": "slide" }, "qMeta": {}, "qData": { "title": "Slide 02", "description": "This is the slide 02", "children": { "qData": { "title": "/title" } } } } ] } } } }

The story contains two children: slide01 and slide02.

Example 3:

[](https://help.qlik.com/en-US/sense-developer/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/CreateVisualizations/list-childs-in-generic-object.htm)

#### The goal of this example is to create a sheet, add children to the sheet, and then get information about each child of the sheet.

1. Create a sheet.

The client sends:

{ "jsonrpc": "2.0", "id": 1, "method": "CreateObject", "handle": 1, "params": [ { "title": "Sheet 1", "description": "Description of sheet 1", "qInfo": { "qId": "SH01", "qType": "sheet" }, "qChildListDef": { "qData": { "title": "/title", "description": "/description", "meta": "/meta", "order": "/order", "type": "/qInfo/qType", "id": "/qInfo/qId", "lb": "/qListObjectDef", "hc": "/qHyperCubeDef" } } } ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 1, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 2 }, "qInfo": { "qId": "SH01", "qType": "sheet" } }, "change": [ 2 ] }

The sheet SH01 is created.

2. Create a list object.

The client sends:

{ "jsonrpc": "2.0", "id": 2, "method": "CreateChild", "handle": 2, "params": [ { "title": "Title for list box 01", "qInfo": { "qId": "LB01", "qType": "ListObject" }, "qListObjectDef": { "qStateName": "$", "qLibraryId": "", "qDef": { "qFieldDefs": [ "Country" ], "qFieldLabels": [ "Country Label" ], "qSortCriterias": [ { "qSortByState": 0, "qSortByFrequency": 0, "qSortByNumeric": 0, "qSortByAscii": 0, "qSortByLoadOrder": 1, "qSortByExpression": 0 } ], "qReverseSort": false }, "qShowAlternatives": false, "qInitialDataFetch": [ { "qTop": 0, "qLeft": 0, "qHeight": 1, "qWidth": 1 } ] } } ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 2, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 3 }, "qInfo": { "qId": "LB01", "qType": "ListObject" } }, "change": [ 3 ] }

The list object LB01 is created.

3. Create a chart.

The client sends:

{ "jsonrpc": "2.0", "id": 3, "method": "CreateChild", "handle": 2, "params": [ { "qInfo": { "qId": "BC01", "qType": "Chart", "metaId": "FullDynamicProperty" }, "qHyperCubeDef": { "qStateName": "$", "qDimensions": [ { "qLibraryId": "", "qNullSuppression": false, "qDef": { "qGrouping": "N", "qFieldDefs": [ "City" ], "qFieldLabels": [ "" ] } } ], "qMeasures": [ { "qLibraryId": "", "qSortBy": { "qSortByState": 0, "qSortByFrequency": 0, "qSortByNumeric": 0, "qSortByAscii": 0, "qSortByLoadOrder": 1, "qSortByExpression": 0, "qExpression": { "qv": "" } }, "qDef": { "qLabel": "", "qDescription": "", "qTags": [ "tags" ], "qGrouping": "N", "qDef": "Count(Holes)" } } ] } } ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 3, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 4 }, "qInfo": { "qId": "BC01", "qType": "Chart", "metaId": "FullDynamicProperty" } }, "change": [ 4 ] }

The chart CH01 is created.

4. Get information about the children of the sheet.

The client sends:

{ "jsonrpc": "2.0", "id": 4, "method": "GetChildInfos", "handle": 2, "params": [] }

The engine returns:

{ "jsonrpc": "2.0", "id": 4, "result": { "qInfos": [ { "qId": "LB01", "qType": "Listbox" }, { "qId": "BC01", "qType": "Chart", "metaId": "FullDynamicProperty" } ] } }

The sheet contains two children: a list object and a chart. The identifier and the type of each child is returned. The full dynamic property metaId is also returned.