# Abort the results of a search in a list object

Abort the results of a search in a list object by using the [AbortListObjectSearch method](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/EngineJSONAPI/Content/service-genericobject-abortlistobjectsearch.htm).

## Example

[](https://help.qlik.com/en-US/sense-developer/Subsystems/EngineAPI/Content/Sense_EngineAPI/DiscoveringAndAnalysing/SearchInData/abort-results-search-list-object.htm)

#### The goal is to create a transient list object and search for all values that start with the letter P. The results of that search are aborted.

1. Create a list object ListObject01. The handle of the request is 1 because the [CreateSessionObject method](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/EngineJSONAPI/Content/service-doc-createsessionobject.htm) applies at app level. The list object contains one field named Country (defined in qFieldDefs). Alternatives values are shown in qData (qShowAlternatives: true). When getting the layout of the object, the first 14 values are displayed (if any). This setting is made in qInitialDataFetch.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "CreateSessionObject",
  "handle": 1,
  "params": [
    {
      "qInfo": {
        "qId": "ListObject01",
        "qType": "ListObject"
      },
      "qListObjectDef": {
        "qStateName": "$",
        "qLibraryId": "",
        "qDef": {
          "qFieldDefs": [
            "Country"
          ],
          "qFieldLabels": [
            "Country Label"
          ],
          "qSortCriterias": [
            {
              "qSortByLoadOrder": 1
            }
          ]
        },
        "qInitialDataFetch": [
          {
            "qTop": 0,
            "qHeight": 14,
            "qLeft": 0,
            "qWidth": 1
          }
        ],
        "qShowAlternatives": true
      }
    }
  ]
}
```

The engine returns:

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

The list object is created and its handle is 2. It contains a list of countries. No values are selected.

2. Search for all values that start with P. The handle of the request is 2 because the handle of the list object is 2.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "SearchListObjectFor",
  "handle": 2,
  "params": [
    "/qListObjectDef",
    "P"
  ]
}
```

The engine returns:

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

The search is successful.

3. Get the search results using the method GetLayout.

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": "ListObject01", "qType": "ListObject" }, "qMeta": {}, "qSelectionInfo": {}, "qListObject": { "qStateName": "$", "qSize": { "qcx": 1, "qcy": 1 }, "qDimensionInfo": { "qFallbackTitle": "Country Label", "qApprMaxGlyphCount": 14, "qCardinal": 1, "qSortIndicator": "A", "qGroupFallbackTitles": [ "Country Label" ], "qGroupPos": 0, "qStateCounts": { "qLocked": 0, "qSelected": 0, "qOption": 22, "qDeselected": 0, "qAlternative": 0, "qExcluded": 0 }, "qTags": [ "$ascii", "$text" ], "qDimensionType": "D", "qGrouping": "N" }, "qExpressions": [], "qDataPages": [ { "qMatrix": [ [ { "qText": "Portugal", "qNum": "NaN", "qElemNumber": 12, "qState": "O", "qHighlightRanges": { "qRanges": [ { "qCharPos": 0, "qCharCount": 1 } ] } } ] ], "qTails": [], "qArea": { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 1 } } ] } } } }

The search has returned one value that starts with the letter P. It is the country Portugal.

4. Abort the search results.

The client sends:

{ "jsonrpc": "2.0", "id": 5, "method": "AbortListObjectSearch", "handle": 2, "params": [ "/qListObjectDef" ] }

The engine returns:

{ "jsonrpc": "2.0", "id": 5, "result": {}, "change": [ 2 ] }

The search results are aborted.

5. Check that the search results are no more shown.

The client sends:

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

The engine returns:

{ "jsonrpc": "2.0", "id": 6, "result": { "qLayout": { "qInfo": { "qId": "ListObject01", "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": 0, "qOption": 22, "qDeselected": 0, "qAlternative": 0, "qExcluded": 0 }, "qTags": [ "$ascii", "$text" ], "qDimensionType": "D", "qGrouping": "N" }, "qExpressions": [], "qDataPages": [ { "qMatrix": [ [ { "qText": "United States", "qNum": "NaN", "qElemNumber": 0, "qState": "O" } ], [ { "qText": "Denmark", "qNum": "NaN", "qElemNumber": 1, "qState": "O" } ], [ { "qText": "Spain", "qNum": "NaN", "qElemNumber": 2, "qState": "O" } ], [ { "qText": "Canada", "qNum": "NaN", "qElemNumber": 3, "qState": "O" } ], [ { "qText": "Netherlands", "qNum": "NaN", "qElemNumber": 4, "qState": "O" } ], [ { "qText": "Switzerland", "qNum": "NaN", "qElemNumber": 5, "qState": "O" } ], [ { "qText": "France", "qNum": "NaN", "qElemNumber": 6, "qState": "O" } ], [ { "qText": "Belgium", "qNum": "NaN", "qElemNumber": 7, "qState": "O" } ], [ { "qText": "United Kingdom", "qNum": "NaN", "qElemNumber": 8, "qState": "O" } ], [ { "qText": "Sweden", "qNum": "NaN", "qElemNumber": 9, "qState": "O" } ], [ { "qText": "Hungary", "qNum": "NaN", "qElemNumber": 10, "qState": "O" } ], [ { "qText": "Germany", "qNum": "NaN", "qElemNumber": 11, "qState": "O" } ], [ { "qText": "Portugal", "qNum": "NaN", "qElemNumber": 12, "qState": "O" } ], [ { "qText": "Slovenia", "qNum": "NaN", "qElemNumber": 13, "qState": "O" } ] ], "qTails": [], "qArea": { "qLeft": 0, "qTop": 0, "qWidth": 1, "qHeight": 14 } } ] } } } }

The search results are no longer displayed. A list of countries is displayed. The country Portugal is part of that list. No values are selected.

## Learn more

* [ListObject](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/EngineJSONAPI/Content/models-listobject.htm)