Double brackets on http GET to docparser

Hi,

I’m having some difficulties with the result of a GET request, where I think n8n is wrapping the response in an extra set of square brackets. I am calling the docparser API to get the output of a pdf parsing process. I’m successfully getting a response, but unfortunately the response is getting wrapped in an additional set of square brackets as follows:

[
  [
    {
      "id": "id",
      "document_id": "docparser_id",
      "remote_id": "unique_internal_id",
      "file_name": "filename.PDF",
      "media_link": "docparser_url_for_media_link",
      "media_link_data": "docparser_url_for link",
      "page_count": 1,
      "uploaded_at": "2021-09-02T10:09:13+00:00",
      "processed_at": "2021-09-02T10:09:24+00:00",
      "uploaded_at_utc": "2021-09-02T10:09:13+00:00",
      "uploaded_at_user": "2021-09-02T10:09:13+00:00",
      "processed_at_utc": "2021-09-02T10:09:24+00:00",
      "processed_at_user": "2021-09-02T10:09:24+00:00",
      "servicedate": "29/06/2021",
      "uprn": "122213",
      "jobnumber": "3647299",
      "engineerid": "5011795",
      "contractorid": "169837",
      "customeraddress": "Address line 1\n    Town\n    Postcode",
      "engineername": "John Smith"
    }
  ]
]

I think this is preventing the response from being seen as JSON, and the Table just has all of the data stuffed into a single column, rather than a neat and tidy column for each of the JSON fields.

I’ve tried the same request with POSTMAN and it only has a single set of square brackets so I’m wondering if this is something that’s happening in n8n.

My workflow is below. Thanks in advance for any help.

Hey @scottjscott!

Did you try using the Split Into Items additional option? To enable it follow these steps:

  1. Click on Add Option and select Split Into Items from the dropdown menu.
  2. Toggle Split Into Items to true.

If this doesn’t solve your issue, you can use the code snippet mentioned here in a Function node to change the structure. Using the Code node | n8n Docs

I’m running on 0.125.0 so I need to do an upgrade to take advantage of the Split Into Items I think. Thanks for the pointers. Tonight I will be doing my first upgrade to my dev environment…:slight_smile:

Thanks @harshil1712 - I’ve upgraded to 0.136.0 and can now use Split Into Items and that’s worked a treat!

That’s wonderful! Have fun :slight_smile: