---
title: Splice
slug: splice
docTags: 
createdAt: 2022-11-25T15:07:18.000Z
---

oSplits a given JSON List into two based on splice index and splice rows. If the list has 5 rows and the ***splice\_index*** is 0 and ***splice\_rows*** is 3, then the output will have two lists. First one will have the first 3 items and the second one will hold the remaining seven.

The function can be used to extract a range from anywhere in the list by configuring the splice\_index and splice rows accordingly.

Note: The splice\_index function is a zero based index. Which means that 0 refers to the first item in the list. &#x20;



### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/list/splice",
  "name": "Splice API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": {\n        \"spliced\": [\n            {\n                \"user_id\": \"bruce@pathfix.com\"\n            }\n        ],\n        \"processed\": [\n            {\n\t\t\t\t\"user_id\": \"paul@pathfix.com\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"user_id\": \"chang@pathfix.com\"\n\t\t\t}\n        ]\n    }\n}",
        "language": "200"
      },
      {
        "id": "yIX64DyIuDPJgBRFSfAWb",
        "code": "{\n    \"message\": \"error\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "28UsDqyeH3QRdmtVamSQT"
  },
  "examples": {
    "languages": [
      {
        "id": "ENcJz9TStG38F0X-taA4x",
        "code": "{\r\n\t\"input\": [\r\n\t\t{\r\n\t\t\t\"user_id\": \"bruce@pathfix.com\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"user_id\": \"paul@pathfix.com\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"user_id\": \"chang@pathfix.com\"\r\n\t\t}\r\n\t],\r\n\t\"splice_index\": \"0\",\r\n\t\"splice_rows\": \"1\"\r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

















