2

Hello basicaly i have this data, compose of name, project, reason and timestamps here's below is the structure

['John Doe', 'Hollywood', 'Good-time', '2022-05-17 15:25:45']

and on the documentation, it only shows how to update an individual cell, but i wanted to update entire row. Thanks in advance

ubuntuMAN
  • 118
  • 2
  • 8
  • Can I ask you about the relationship between your showing value of `['John Doe', 'Hollywood', 'Good-time', '2022-05-17 15:25:45']` and `i wanted to update entire row.`? – Tanaike May 17 '22 at 08:39

1 Answers1

1

You have 2 ways to update the content of you spreadsheet using gspread.

  1. Using update method It will update the specified range with values you provide. Example: updating cells A2 to B2
worksheet.update("A2:B2", [[42], [43]])
  1. Using update_cells You create a list of Cell object with each value for each cell then update the cells

Examples: updating cells A2 to B2

C1 = Cell(2, 1, 42)
C2 = Cell(2, 2, 43)
worksheet.update_cells([C1, C2])
Lavigne958
  • 442
  • 5
  • 12
  • the update_cells method was what I was searching for. However you may need to declare the Cell class in the beginning if you get an error - from gspread import Cell – MartinG Feb 03 '23 at 01:28