Google Sheets | How can I append multiple items without overwitting?

Describe the problem/error/question

I want to append the two items (Box 01 and Box 02) to the sheet but when I execute it, the second item overwrite the first one and only append Box 02 which is “DEF” to the sheet.

image

Is it possible to append these two items to the same column? or do I have to create an additional node just to append the second item after the first node?

Information on your n8n setup

  • n8n version: 0.209.4
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Desktop App
  • Operating system: Windows 10

Hi @rexnguyen ,
welcome back to the n8n community :wave:

The behavior you observe is normal: in your case, Box 01 and Box 02 are two fields of the same item, so they are not treated separately. The Google Sheets node treats them simultaneously and Box 02 instantly overwrites Box 01.

To achieve what you want you should have the fields to add to the Googe Sheet in separate n8n items. Something like:

[
  {"box": "ABC"},
  {"box": "DEF"},
]

In this case, each {"box": "..."}, is treated separately and its content will be added to a new row (more info here)

To split the fields in separate n8n items you can use a Code node or a couple of Set nodes and a Merge node. Here’s an example workflow:

Let me know if this solves you problem
Best

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.