> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/api/guides/introduction/the-output-module-query-language/page-the-results.md).

# Page the results

The Output Module also supports paging the results for the root node of the query. You can specify an offset and a length parameter to limit the results to a subset of the complete list.

| JSON key      | Default value | Description                                                                                                                                                                  |
| ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| displayStart  | 0             | The offset in the list of results. This offset is a zero-based index value.                                                                                                  |
| displayLength | -1            | The maximum total number of results to return. A negative value means unlimited.                                                                                             |
| maxCountLimit | -1            | The maximum count value.  A count of all records can lead to performance problems. When paging, you can limit the max count to this value. Passing 0 means no count is done. |

{% tabs %}
{% tab title="JSON" %}

```json
{
  "ViewConfig": {
    "displayStart": 10,
    "displayLength": 5,
    "maxCountLimit": 10000,
    "Resources": {
      "Community": {
        "Id": { "name": "communityId" },
        "Name": { "name": "communityName" },
        "Description": { "name": "communityDescription" },
        "Order": [ { "Field": { "name": "communityName", "order": "ASC" } } ]
      }
    }
  }
}
```

{% endtab %}

{% tab title="YAML" %}

```yaml
---
ViewConfig:
  displayStart: 10
  displayLength: 5
  maxCountLimit: 10000
  Resources:
    Community:
      Id:
        name: "communityId"
      Name:
        name: "communityName"
      Description:
        name: "communityDescription"
      Order:
      -
        Field:
          name: "communityName"
          order: "ASC"
```

{% endtab %}
{% endtabs %}

The example query above selects page 3 of all communities, with five results per page.

{% hint style="info" %}

* Paged results should always be sorted, otherwise the results might seem inconsistent from page to page.
* The paged results list is recalculated upon each request.
* All entities that have been added or removed will appear/disappear from the list, modifying the indexes of the elements in the results list.
* The Collibra Console allows limiting the number of results returned by queries. The values range from 10,000 to 100,000. If enabled, and the limit is set, then:
  * The default `displayLength` value (-1) is overwritten by the limit set through the console.
  * If the `displayLength` set  in the `ViewConfig`/`TableViewConfig` is larger than the limit value set in the Collibra Console, an exception is thrown.
    {% endhint %}

## Cursor-based pagination

Offset-based pagination does not scale for a big data set. The bigger the offset, the slower the response time. For a bulk export of many assets, it's better to use cursor-based pagination:

* Run the initial query sorting by ID. This is the recommended option to achieve maximum performance. Use a medium page size, such as 10,000.
* Read the results and keep the last ID value.
* Pass this ID as a filter to the next query.
* Repeat the process until the number of returned results is less than the page size. This means you retrieved all data.

```json
{
  "ViewConfig": {
    "displayLength": 10,
    "Resources": {
      "Asset": {
        "Id": { "name": "assetId" },
        "Signifier": { "name": "assetName" },
        "Order": [
          {
            "Field": {
              "name": "assetId",
              "order": "ASC"
            }
          }
        ],
        "Filter": {
          "Field": {
            "name": "assetId",
            "operator": "GREATER",
            "value": "00000000-0000-0000-0000-000000005032"
          }
        }
      }
    }
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.collibra.com/api/guides/introduction/the-output-module-query-language/page-the-results.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
