I am struggling to write codes that find me the first empty row of a google sheet.
I am using gspread package from github.com/burnash/gspread
I would be glad
If you can count on all of your previous rows being filled in:
len(sheet.get_all_values()) + 1
will give you the first free row
get_all_values
returns a 2D list of the sheet's data. Each nested list is a row, so the length of the 2D list is the number of rows that has any data.
Similar problem is first free column:
from xlsxwriter.utility import xl_col_to_name
# Square 2D list, doesn't matter which row len you check
column_count = len(sheet.get_all_values()[0])
column = xl_col_to_name(column_count)