AC Daily Log Part 5: Update Google Sheet Daily Log

Andrew Chien
2 min readMay 23, 2020

--

After getting the result of ac daily log from 2017 to 2019, the next step is to upload the result to Google sheet. Firstly, following the way of getting the Google sheet data via gspread, we get the wks_17_19 worksheet. After that, field row is created by the pre-processed data df2_17to19. Here as update_cells is used as the way to update the Google sheet, cell_list column range need to be set beforehand. The length of the field is 11, so it’s matched with the column k as the following image. Therefore, range is set as range('A1:K'+str( len( df2_17to19 )+1 )). The reason len( df2_17to19 ) plus 1 is because the field row also need to be included.

The field row of daily log from 2017 to 2019

After the cell_list is set, the first for loop is run to put the value of field into the cell_list. And lastly, two for loops are run to put the value of daily log into the cell_list. (The last for loop is used to find the field name.) The following is the code for updating the Google sheet.

Photo by Markus Winkler on Unsplash

Five days a week, I read my goals before I go to sleep and when I wake up. There are 10 goals around health, family and business with expiration dates, and I update them every six months.

Daymond John

--

--

No responses yet