Write to file a Google Sheet

Hello,
I’m trying to save a generated json from the Google Sheet node to file.

Google Sheet → Move Binary Data → Write binary file

What I get is that the write node save only the last line of the gogole sheet to file.
If I set the write node to “execute once” it only saves the first line of the google sheet, if I don’t set the flag, it only saves the last line.
As if an append flag were needed.

Can you please help me?

Workflow:

Configuration and results of Move Binary data node

Configuration and results of Write Binary file node

Thank You

Hello,
sorry I opened the topic after hours of study and attempts.
I just managed to find the solution and the place for those to whom it might be useful.

It was necessary to add the spreadsheet file node between the move binary and write node

@marco.fucito, thanks for sharing with the community.

It will also help if you share the workflow here in the community.

Sure, here’s the code.
A google sheet node must be given as input

{
  "nodes": [
    {
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "keepSource": true,
          "useRawData": false
        }
      },
      "name": "Move Binary Data",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        660,
        380
      ],
      "executeOnce": false
    },
    {
      "parameters": {
        "fileName": "/shared_folder/spreadsheet.csv"
      },
      "name": "Write Binary File",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [
        1210,
        380
      ],
      "executeOnce": false
    },
    {
      "parameters": {
        "operation": "toFile",
        "fileFormat": "csv",
        "options": {}
      },
      "name": "Spreadsheet File",
      "type": "n8n-nodes-base.spreadsheetFile",
      "typeVersion": 1,
      "position": [
        930,
        380
      ],
      "alwaysOutputData": true
    }
  ],
  "connections": {
    "Move Binary Data": {
      "main": [
        [
          {
            "node": "Spreadsheet File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Spreadsheet File": {
      "main": [
        [
          {
            "node": "Write Binary File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
2 Likes