node-google-spreadsheet icon indicating copy to clipboard operation
node-google-spreadsheet copied to clipboard

Insert a row at a specific position in google sheet

Open vaideshshank opened this issue 4 years ago • 3 comments

Hi @theoephraim , I wanted to inserted a row at specific position (row number A,B,C,etc) in the sheet using add row function. I guess it always appends the row after the last filled row.

vaideshshank avatar Jun 30 '20 02:06 vaideshshank

The addRows function internally uses sheets API append functionality which really is looking for a "table" of data within you sheet and then appending to the end, so unfortunately it wouldnt work.

Looks like to add rows in the middle of the existing data, you'd need to use the insertDimension api endpoint which I have not yet implemented.

PRs welcome!

theoephraim avatar Aug 17 '20 06:08 theoephraim

Sure , I'll try to find a solution for this. I was able to get a workaround to this problem some time ago for implementation in a project. I'll try to revisit this thing in some days.

vaideshshank avatar Aug 17 '20 19:08 vaideshshank

@theoephraim , #428 Seems to have added insertDimension.

DanielBailey-web avatar Jul 29 '21 01:07 DanielBailey-web