n8n data insertion to Google Sheets not functioning as intended: overwrites instead of adding new rows

I’m having trouble with n8n and Google Sheets. I set up a webhook to add info to my ‘M2’ sheet. I’m using the Google Sheet node and picked the ‘Append’ option. I even tried ‘Append or Update’ but no luck.

The weird thing is, n8n says it’s working fine and connects to the sheet. But when I look at the sheet, it’s not adding new rows at the end. Instead, it’s wiping out everything and starting over from the top row. Even my column headers are gone!

I double-checked my setup and can’t figure out what’s wrong. Has anyone run into this before? Any ideas on how to fix it so it actually adds new rows instead of replacing everything?

Here’s a simple example of what I’m trying to do:

function addRowToSheet(data) {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('M2');
  sheet.appendRow(data);
}

// This should add a new row, not replace existing ones
addRowToSheet(['John', 'Doe', 30]);

But it’s not working like that. Help!

Hey there, I’ve actually faced a similar issue with n8n and Google Sheets before. It can be pretty frustrating when things don’t work as expected. In my experience, the problem was often related to the sheet ID or range configuration in the Google Sheets node.

Have you double-checked that you’re using the correct sheet ID and that the range is properly set? Sometimes, if the range isn’t specified correctly, it can lead to unexpected behavior like overwriting existing data.

Another thing to consider is the API version you’re using. I found that switching to a newer version of the Google Sheets API in n8n sometimes resolved these kinds of issues.

If those don’t help, it might be worth trying to create a new Google Sheets node from scratch and carefully going through each setting. I’ve had instances where a small misconfiguration caused similar problems.

Lastly, if all else fails, you could try using the ‘Add’ operation instead of ‘Append’ or ‘Append or Update’. It might not be ideal, but it could be a temporary workaround while you troubleshoot the root cause.

Hope this helps! Let us know if you manage to solve it.

yo mia, i had this happen 2. check ur sheet permissions - sometimes it gets messed up n n8n cant write properly. also, try using the ‘Update’ option instead of ‘Append’. it worked for me when append was actin weird. if nothin else works, maybe try a different google account? good luck!

I’ve encountered this issue before, and it’s often due to incorrect range specification in the Google Sheets node. Make sure you’re using the full range notation, including the sheet name, like ‘M2!A:Z’. This tells n8n exactly where to append the data.

Also, check if you’re accidentally overwriting the entire sheet instead of appending. In the Google Sheets node settings, ensure ‘Range’ is set to the first empty row or a range that extends beyond your existing data.

If that doesn’t work, try clearing the OAuth connection and reconnecting your Google account in n8n. Sometimes authentication issues can cause unexpected behavior.

Lastly, consider using the ‘Add’ operation as a temporary fix while troubleshooting. It’s not ideal, but it might help isolate the problem. Good luck, and let us know if you need further assistance!