Search code examples
androidgoogle-sheetsgoogle-drive-apigoogle-sheets-api

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


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 ?


Solution

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