---
title: Compare Two Lists (Text List and JSON)
slug: compare-two-lists-text-list-and-json
docTags: 
createdAt: 2021-12-22T07:28:32.000Z
---

Compares two lists and returns matched or unmatched values. The input\_key instruction will only be evaluated if the "input" list type is a list of JSON Objects.

comparison\_rule supported can be "equals" or "not-equals"&#x20;



### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/list/compare",
  "name": "Compare Two Lists",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": [\n        \"janet@pathfix.com\"\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\"ron@pathfix.com\",\r\n\t\t\"janet@pathfix.com\"\r\n\t],\r\n\t\"search_input\": [{\r\n\t\t\"user_email\": \"ron@pathfix.com\"\r\n\t}],\r\n\t\"comparison_rule\": \"not-equals\",\r\n\t\"comparison_search_key\": \"user_email\",\r\n\t\"input_key\": \"\"\r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::















