# List the linked objects of a generic object

List the objects linked to a generic object by using the [GetLinkedObjects method](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineJSONAPI/Content/service-genericobject-getlinkedobjects.htm).

## Example

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

#### The goal is to get the list of all objects linked to a generic object.

Prerequisites steps are:

* Creation of the app object SH01
* Creation of the app object SH02 that is linked to SH01.
* Creation of the child LB01 that is linked to SH01

1. Create the app object SH01.

The client sends:

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

The engine returns:

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

The sheet SH01 is created.

2. Create the app object SH02 that is linked to the object SH01 (qExtendsId is SH01).

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "CreateSessionObject",
  "handle": 1,
  "params": [
    {
      "qInfo": {
        "qId": "SH02",
        "qType": "sheet"
      },
      "qExtendsId": "SH01"
    }
  ]
}
```

The engine returns:

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

The sheet SH02 is created.

3. Create the child object LB01 that is linked to the object SH01 (qExtendsId is SH01).

The client sends:

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

The engine returns:

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

The child object is created.

4. List the objects linked to the object SH01. The handle of the request is 2 because the handle of the object SH01 is 2.

The client sends:

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

The engine returns:

{ "jsonrpc": "2.0", "id": 4, "result": { "qItems": [ { "qRootId": "SH01", "qInfo": { "qId": "LB01", "qType": "linked" } }, { "qRootId": "SH02", "qInfo": { "qId": "SH02", "qType": "sheet" } } ] } }

The linked objects LB01 and SH02 are linked to the sheet SH01. The root identifier of the object LB01 is SH01 since the object LB01 is a child of the sheet SH01. The root identifier of the object SH02 is SH02 since the sheet SH02 is an app object.

## Learn more

* [Create an object that is linked to another object](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/CreateVisualizations/create-object-linked-to-other-object.htm)
* [Get the properties of an object](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineAPI/Content/Sense_EngineAPI/WorkingWithAppsAndVisualizations/SetGetProperties/get-properties.htm)