---
title: Merge Two JSON Object Lists on Key
slug: merge-two-json-object-lists-on-key
docTags: 
createdAt: 2021-12-22T07:28:32.000Z
---

Merges Items  JSON Object Lists based on a definable matching key value in both of them. The Final List has the merge\_list combined with matching items in the input list.



### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/list/mergeonkey",
  "name": "Merge Two JSON Object List on Key API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": [\n        {\n            \"user_id\": \"michelle@pathfix.com\",\n            \"name\": \"Mich\",\n            \"new_user_id\": \"michelle@pathfix.com\",\n            \"new_name\": \"Michelle\"\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\t\"user_id\": \"michelle@pathfix.com\",\r\n\t\t\t\"name\": \"Mich\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"user_id\": \"sophie@pathfix.com\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"user_id\": \"dominic@pathfix.com\"\r\n\t\t}\r\n\t],\r\n\t\"merge_list\": [{\r\n\t\t\t\"user_id\": \"michelle@pathfix.com\",\r\n\t\t\t\"name\": \"Michelle\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"user_id\": \"sophie@pathfix.com\",\r\n\t\t\t\"name\": \"Sophie\"\r\n\t\t}\r\n\t],\r\n    \"input_key\":\"user_id\"\r\n\t\"merge_key\": \"user_id\",\r\n\t\"merge_prefix\": \"new_\"\r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::















