Issue
I have a similar data as below in google sheet. I want to update the pageId for pagename "abc".
I'm able to update manually passing B3 sheet.update('B3','updated_value')
but How should I get B3 by adding a if condition where pagename=abc in python code.
Need help.
Solution
If your provided script in your comment is used, how about the following modification?
Modified script:
# Your provided script in your comment.
records_data = sheet_instance.get_all_records()
test = sheet_instance.col_values(1)
rownum = test.index('abc') + 1
print(rownum)
row = sheet_instance.row_values(rownum)
print(row)
sheet_instance.update_cell(rownum, 2, 'Updated') # Added
- In this case,
rownum
can be directly used.
Reference:
Answered By - Tanaike
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.