-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Spreadsheet#append using the dedicated Google Drive API #349
base: master
Are you sure you want to change the base?
Conversation
This allows to append data efficiently to an existing spreadsheet without having to load and submit the whole worksheet everytime we want to add a new row.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request! Overall looks good, but left some comments.
Thanks for your feedbacks. Please let me know if my modifications are clear enough now. |
@gimite Can you review again please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be so late. I was busy recently.
@@ -134,7 +134,24 @@ def batch_update(requests) | |||
|
|||
# Append values to a spreadsheet by first searching for a data table at a range, | |||
# then appending the specified values at the end of this data table. | |||
def append(range_name, values, override_params = {}) | |||
# | |||
# +range+ The A1 notation of a range to search for a logical table of data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand how it determines the worksheet (i.e., tab) which the value is added to. Assuming the spreadsheet has two worksheets "Sheet 1" and "Sheet 2", and you specify "A1" here, does it add values to A1 of Sheet 1 or Sheet 2? Do you know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry, I don't have more information than what Google provides at https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand how it determines the worksheet (i.e., tab) which the value is added to. Assuming the spreadsheet has two worksheets "Sheet 1" and "Sheet 2", and you specify "A1" here, does it add values to A1 of Sheet 1 or Sheet 2? Do you know?
@gimite You can specify "Sheet1!A1". You can find examples in the following URL.
https://developers.google.com/sheets/api/samples/writing#write_a_single_range
This allows to append data efficiently to an existing spreadsheet
without having to load and submit the whole worksheet every time we
want to add a new row.