# Select all alternative values of a list object

Select all the alternative values in a list object by using the [SelectListObjectAlternative method](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/EngineJSONAPI/Content/service-genericobject-selectlistobjectalternative.htm).

## Example

[](https://help.qlik.com/en-US/sense-developer/Subsystems/EngineAPI/Content/Sense_EngineAPI/DiscoveringAndAnalysing/MakeSelections/select-alternative-values-list-object.htm)

#### The first step of the example is to create a list object in a sheet that is already created. The handle of the sheet is 2. The goal is to select all the alternative values of the list object.

The dimension Dim1 has been created previously.

1. Create the list object. The handle of the request is 2 because the list object is created inside a sheet and the sheet has 2 as a handle.

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": 5,
            "qLeft": 0,
            "qWidth": 1
          }
        ],
        "qShowAlternatives": true
      },
      "title": "A listbox",
      "description": "Description of the listbox"
    }
  ]
}
```

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 ( "qId": "LB01") is created and its handle is 3.

2. Select the first value.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "SelectListObjectValues",
  "handle": 3,
  "params": [
    "/qListObjectDef",
    [
      1
    ],
    false
  ]
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "qSuccess": true
  },
  "change": [
    3
  ]
}
```

The selection is successful ("qSuccess": true).

3. Get the layout of the list object.

The client sends:

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

The engine returns:

{ "jsonrpc": "2.0", "id": 4, "result": { "qLayout": { "qInfo": { "qId": "LB01", "qType": "ListObject" }, "qMeta": {}, "qSelectionInfo": {}, "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": 1, "qOption": 0, "qDeselected": 0, "qAlternative": 21, "qExcluded": 0 }, "qTags": [ "$ascii", "$text" ], "qDimensionType": "D", "qGrouping": "N" }, "qExpressions": [], "qDataPages": [ { "qMatrix": [ [ { "qText": "United States", "qNum": "NaN", "qElemNumber": 0, "qState": "A" } ], [ { "qText": "Denmark", "qNum": "NaN", "qElemNumber": 1, "qState": "S" } ], [ { "qText": "Spain", "qNum": "NaN", "qElemNumber": 2, "qState": "A" } ], [ { "qText": "Canada", "qNum": "NaN", "qElemNumber": 3, "qState": "A" } ], [ { "qText": "Netherlands", "qNum": "NaN", "qElemNumber": 4, "qState": "A" } ] ], "qTails": [], "qArea": { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 5 } } ] }, "title": "A listbox", "description": "Description of the listbox" } } }

The first value ("qElemNumber": 1) is selected and the other values are in alternate state.

4. Select all alternative values.

The client sends:

{ "jsonrpc": "2.0", "id": 5, "method": "SelectListObjectAlternative", "handle": 3, "params": [ "/qListObjectDef", false ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 5, "result": { "qSuccess": true }, "change": [ 3 ] }

The selection is successful ("qSuccess": true).

5. Get the layout of the list object.

The client sends:

{ "jsonrpc": "2.0", "id": 6, "method": "GetLayout", "handle": 3, "params": [] }

The engine returns:

{ "jsonrpc": "2.0", "id": 6, "result": { "qLayout": { "qInfo": { "qId": "LB01", "qType": "ListObject" }, "qMeta": {}, "qSelectionInfo": {}, "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": 21, "qOption": 0, "qDeselected": 0, "qAlternative": 1, "qExcluded": 0 }, "qTags": [ "$ascii", "$text" ], "qDimensionType": "D", "qGrouping": "N" }, "qExpressions": [], "qDataPages": [ { "qMatrix": [ [ { "qText": "United States", "qNum": "NaN", "qElemNumber": 0, "qState": "S" } ], [ { "qText": "Denmark", "qNum": "NaN", "qElemNumber": 1, "qState": "A" } ], [ { "qText": "Spain", "qNum": "NaN", "qElemNumber": 2, "qState": "S" } ], [ { "qText": "Canada", "qNum": "NaN", "qElemNumber": 3, "qState": "S" } ], [ { "qText": "Netherlands", "qNum": "NaN", "qElemNumber": 4, "qState": "S" } ] ], "qTails": [], "qArea": { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 5 } } ] }, "title": "A listbox", "description": "Description of the listbox" } } }

All alternative values are selected.