2

I'm using Google Sheets API v4[1] to manipulate a Spreedsheet using Java Script Client API[2].

How can I add a new row without using the range property of the spreadsheets.values.update method [3]. Is this the only way to add rows using Google Java Script client API?

I just want to add a new row to the end (after last non-empty) of an existing sheet.

Using the rowCount or endRowIndex properties from the sheet object [4] is not an option because I want to add after the last non empty row.

[1] https://developers.google.com/sheets/reference/rest/

[2] https://developers.google.com/sheets/quickstart/js

[3] https://developers.google.com/sheets/reference/rest/v4/spreadsheets.values/update

[4] https://developers.google.com/sheets/reference/rest/v4/spreadsheets#sheet

1 Answer 1

4

You can append new row after your last row by using the AppendCellsRequest of the Spreadsheet collection:

https://developers.google.com/sheets/reference/rest/v4/spreadsheets/request#appendcellsrequest

Sign up to request clarification or add additional context in comments.

1 Comment

Hey @user4426017, worked fine here! That's exactly what I was looking for. Many thanks o/

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.