---
title: Convert to Paged List
slug: convert-to-paged-list
docTags: 
createdAt: 2022-11-25T15:07:18.000Z
---

Splits a given JSON List into pages based on page size. If the list has 12 rows and the ***page\_index*** is 5, then the output will have 3 lists. First one will have the first 5 items, second one will have 5 items and the third will hold the remaining 2.

The function can be used to convert a large list to be used in a paged list.





### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/list/topages",
  "name": "Convert to Paged List API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": [\n        [\n            {\n                \"item\": 1\n            },\n            {\n                \"item\": 2\n            },\n            {\n                \"item\": 3\n            },\n            {\n                \"item\": 4\n            },\n            {\n                \"item\": 5\n            }\n        ],\n        [\n            {\n                \"item\": 6\n            },\n            {\n                \"item\": 7\n            },\n            {\n                \"item\": 8\n            },\n            {\n                \"item\": 9\n            },\n            {\n                \"item\": 10\n            }\n        ],\n        [\n            {\n                \"item\": 11\n            },\n            {\n                \"item\": 12\n            }\n        ]\n    ],\n    \"size_in_bytes\": 313.0\n}",
        "language": "200"
      },
      {
        "id": "yIX64DyIuDPJgBRFSfAWb",
        "code": "{\n    \"message\": \"error\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "28UsDqyeH3QRdmtVamSQT"
  },
  "examples": {
    "languages": [
      {
        "id": "ENcJz9TStG38F0X-taA4x",
        "code": "{\n    \"page_size\":5,\n    \"input\": [\n        {\n            \"item\": 1\n        },\n        {\n            \"item\": 2\n        },\n        {\n            \"item\": 3\n        },\n        {\n            \"item\": 4\n        },\n        {\n            \"item\": 5\n        },\n        {\n            \"item\": 6\n        },\n        {\n            \"item\": 7\n        },\n        {\n            \"item\": 8\n        },\n        {\n            \"item\": 9\n        },\n        {\n            \"item\": 10\n        },\n        {\n            \"item\": 11\n        },\n        {\n            \"item\": 12\n        }\n    ]\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

















