Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

genezys
Copy link

@genezys genezys commented Aug 27, 2019

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.

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.
Copy link
Owner

@gimite gimite left a 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.

lib/google_drive/spreadsheet.rb Show resolved Hide resolved
lib/google_drive/spreadsheet.rb Outdated Show resolved Hide resolved
lib/google_drive/spreadsheet.rb Show resolved Hide resolved
@genezys
Copy link
Author

genezys commented Sep 10, 2019

Thanks for your feedbacks. Please let me know if my modifications are clear enough now.

@genezys
Copy link
Author

genezys commented Sep 30, 2019

@gimite Can you review again please?

@genezys genezys requested a review from gimite October 6, 2019 21:03
Copy link
Owner

@gimite gimite left a 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.

lib/google_drive/spreadsheet.rb Show resolved Hide resolved
@@ -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.
Copy link
Owner

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?

Copy link
Author

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

Copy link

@sohgo sohgo May 15, 2021

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

test/test_google_drive.rb Outdated Show resolved Hide resolved
test/test_google_drive.rb Outdated Show resolved Hide resolved
test/test_google_drive.rb Outdated Show resolved Hide resolved
@genezys genezys requested a review from gimite August 26, 2020 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants