Remove Parent Field in JSON Response

Hi,

Ive been trying to make a HTTP Request which gives me particular contacts. The issue with this is that I want the contacts to in each row in the table but here its not getting due to the parent field contact. Is there a function with which we can remove the parent field and get list of contacts in the table. Also I do not need has-more vid-offset in the response.

Thanks

You can use a function node for that. Check the example below:

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://mockup-pj5l0yxsjrbr.runkit.sh/",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const results = []\n\nfor (const item of items[0].json.contacts) {\n\n      results.push({\n        json: item\n      })\n    \n}\n\nreturn results;"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        710,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
2 Likes

Thanks a lot for this @RicardoE105 :grinning: