Json data in datafield instead of rows

Hi,
I’ve just started to use N8N and I am suprised by how easy it is in use. I am not a programmer but I could quite easily set up some workflows.

However I am facing some difficulties now. I use a HTTP Request to get JSON information. The data is returned in a data string instead of JSON columns/rows. I want to export this information to mysql.

It is in an extra array but I cannot get the date out of it.
Could someone help me?

@heestp welcome to the community.

Can you please share the response of the HTTP Node?

Here the Data field:

[ { "id": "dc5e5608-fcb7-44cd-8fb9-9df7a3a98ecd", "board_id": "799a2041-9dcf-4de0-9477-828e7b110675", "source_type": "custom", "external_ref": null, "status": "not_planned", "progress": "open", "position": 0, "start": null, "end": null, "name": "Test", "description": "", "due_date": null, "meta": null, "custom_fields": [ { "name": "Productielijn", "type": "text", "priority": 0, "value": "Melklijn" }, { "name": "Aantal te produceren", "type": "number", "priority": 1, "options": { "unit": "", "decimals": 0, "align": "left" }, "value": 288 }, { "name": "Werkordernummer", "type": "number", "priority": 3, "options": { "unit": "", "decimals": 0, "align": "left" }, "value": 4875 } ], "created_at": "2020-09-21T17:32:18Z", "updated_at": "2020-09-21T17:33:30Z", "warnings": [] } ]

I think the problem is the response is with an extra array:

{
    "count": 1,
    "limit": 0,
    "offset": 0,
    "data": [
        {
            "id": "12dbb0d4-4471-4a7a-a358-bbb8b47b1a83",
            "board_id": "799a2041-9dcf-4de0-9477-828e7b110675",
            "source_type": "custom",
            "external_ref": null,
            "status": "planned",
            "progress": "open",
            "position": null,
            "start": "2020-09-16",
            "end": "2020-09-16",
            "name": "1x Natursoy Rijstwafels Puur Bio 12st",
            "description": "WO: 5468, 144 dozen per pallet",
            "due_date": "2020-09-21",
            "meta": null,
            "custom_fields": [
                {
                    "name": "Productielijn",
                    "type": "text",
                    "priority": 0,
                    "value": "Melklijn"
                },
                {
                    "name": "Aantal te produceren",
                    "type": "number",
                    "priority": 1,
                    "options": {
                        "unit": "",
                        "decimals": 0,
                        "align": "left"
                    },
                    "value": 144
                },
                {
                    "name": "Gewenste leverdatum",
                    "type": "date",
                    "priority": 2,
                    "value": "2020-09-24T15:08:20.876Z"
                }
            ],
            "created_at": "2020-09-21T14:23:38Z",
            "updated_at": "2020-09-21T15:08:23Z",
            "warnings": [],
            "cards": [
                {
                    "id": "9993549e-ec9a-46dd-b063-16ecf5d1a61c",
                    "collection_id": "12dbb0d4-4471-4a7a-a358-bbb8b47b1a83",
                    "status_id": "faa2a273-34e7-4e87-b44e-b428879cdf90",
                    "stage_id": "e6764d0b-cc7b-4934-a0e5-1ebf8b3f1cc8",
                    "date": "2020-09-16",
                    "start": "2020-09-16",
                    "end": "2020-09-16",
                    "position": 0,
                    "name": "1x Natursoy Rijstwafels Puur Bio 12st",
                    "description": "WO: 5468, 144 dozen per pallet",
                    "time": null,
                    "created_at": "2020-09-21T14:49:43Z",
                    "updated_at": "2020-09-21T14:49:43Z",
                    "days_diff": 0
                }
            ]
        }
    ]
}

The following node should do the trick:

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "return items[0].json.data.map(item => {\n  return {\n    json: item,\n  }\n});"
      },
      "name": "Function1",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {}
}

Thanks it works!!