Google Sheets API v4 - How to get the last row with value?

seba123neo picture seba123neo · May 19, 2016 · Viewed 15.2k times · Source

How to get the last row with value in the new Google Sheets API v4 ?

i use this to get a range from a sheet:

mService.spreadsheets().values().get("ID_SHEET", "Sheet1!A2:B50").execute();

how to detect the last row with value in the sheet ?

Answer

A Paracha picture A Paracha · May 21, 2016

You can set the range to "A2:D" and this would fetch as far as the last data row in your sheet.