The idea is:
Hey all!
Is it possible to get the option to add a row in a specific place in Google Sheets? For example, I'd like to add new rows at the top, just below the column names row. It would be useful for when I build logs in Sheets for not so tech savvy clients so that they don't have to scroll all the way to the bottom when the logs get busy.
Yes, it is possible to add a row in a specific place in Google Sheets using n8n, but not directly through a simple “Insert Row” option in the standard Append or Update operations. The default behavior of the Google Sheets node in n8n is to append new rows at the end of the data.
To insert a row in a specific place, you must use a workaround to force the data into a designated position.
Recommended Workarounds for Inserting Rows
Use “Write Range” to Specific Location
Set the Google Sheets node to Write Range mode.
In the range parameter, specify the exact cell where the new data should start (e.g., ‘Sheet1’!A2:E2).
Note: This will overwrite existing data in that range, so you must use this approach carefully, often in combination with reading existing data, manipulating it, and rewriting the sheet.
Use Google Apps Script + HTTP Request (Most Reliable)
Create a script in your Google Sheet that inserts a blank row at a specific location (e.g., sheet.insertRowBefore(2);).
In n8n, use the HTTP Request node to call this Google Apps Script URL with the new row’s data.
Read → Manipulate → Rewrite
Read all data from the sheet using the Google Sheets node.
Use a Code node (JavaScript) or Edit Fields node to insert the new data item into the desired position in the array.
Update the entire sheet with the new, modified data array using the Update operation.
Thank you!
I am aware of some of the possible workarounds. I was just thinking, though, that it would be much easier to have an option in the node itself that would allow you to choose where the row will be added. I’m not an engineer, so correct me if I’m wrong, but it doesn’t seem like it would be too difficult to implement.
Thanks for your tips anyway!
1 Like