JSON to CSV problem

Hello, I have a small problem where I can’t get any further.
I want to create a spreadsheet from a json structure.

Even if I use a simple example from the forum(https://community.n8n.io/t/json-to-csv-or-spreadsheet/977), it doesn’t work. It always comes up:

Entries exist but they do not contain any JSON data.

What am I doing wrong?

Hey @Zovaal!

Welcome to the community! Can you please share your workflow (How can I contribute? | Docs)? From where are you getting the data? Which nodes are you using? How are you using n8n?

Thank you for the quick reply.
Even with the test from the other thread I get the error. This is the last one I used.

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      firstName: 'Jim',\n      lastName: 'Miller',\n    }\n  },\n  {\n    json: {\n      firstName: 'Kim',\n      lastName: 'Smith',\n    }\n  }\n];"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "operation": "toFile",
        "fileFormat": "csv",
        "options": {}
      },
      "name": "Spreadsheet File",
      "type": "n8n-nodes-base.spreadsheetFile",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {
    "Function": {
      "main": [
        [
          {
            "node": "Spreadsheet File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Hey @Zovaal!

Thank you for sharing the workflow. The message that you get is expected since you’re trying to view Binary data in the Table view. However, your node is executing successfully!
You take either of the two approaches to view the data that gets written to the file:

  1. Click on the Binary tab to view the Binary file. (Based on the OS you’re using and your browser, you may not be able to view the file in n8n)

  1. Connect the Move Binary Data node to the Spreadsheet File node to view the data that gets written to the Binary file.

Oh okay, i understand! Thanks a lot! :+1:

1 Like