---
title: Combine Lists By Key
slug: combine-lists-by-key
docTags: 
createdAt: 2022-11-25T15:02:30.000Z
---

Combines or Merges items from combine list into every JSON Object of the input list. The substitution rules are used to define what the output should be like. The two lists are combined by keys



### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/list/combine_by_key",
  "name": "Combine One to Many API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": [\n        {\n            \"q\": \"Your first and last name\",\n            \"a\": \"Bruce Wayne\",\n            \"q_id\": \"q1\"\n        },\n        {\n            \"q\": \"Company Name\",\n            \"a\": \"Wayne Enterprises\",\n            \"q_id\": \"q2\"\n        }\n    ],\n    \"size_in_bytes\": 585.0\n}",
        "language": "200"
      },
      {
        "id": "yIX64DyIuDPJgBRFSfAWb",
        "code": "{\n    \"message\": \"error\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "28UsDqyeH3QRdmtVamSQT"
  },
  "examples": {
    "languages": [
      {
        "id": "ENcJz9TStG38F0X-taA4x",
        "code": "{\n    \"input\": [\n        {\n            \"questionId\": \"q1\",\n            \"answer\": \"Bruce Wayne\"\n        },\n        {\n            \"questionId\": \"q2\",\n            \"answer\": \"Wayne Enterprises\"\n        }\n    ],\n    \"input_combine\": [\n        {\n            \"title\": \"Your first and last name\",\n            \"questionItem\": {\n                \"question\": {\n                    \"questionId\": \"q1\"\n                }\n            }\n        },\n        {\n            \"title\": \"Company Name\",\n            \"questionItem\": {\n                \"question\": {\n                    \"questionId\": \"q2\"\n                }\n            }\n        }\n    ],\n    \"input_key\": \"questionId\",\n    \"input_combine_key\": \"questionItem.question.questionId\",\n    \"output\": {\n        \"q\": \"{{input_combine.title}}\",\n        \"a\": \"{{input.answer}}\",\n        \"q_id\": \"{{input.questionId}}\"\n    }\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::







