Skip to content

Commit

Permalink
fix addRows offset issue - force google API to start add rows at colu…
Browse files Browse the repository at this point in the history
…mn A
  • Loading branch information
theoephraim committed Aug 17, 2020
1 parent b2275eb commit 5c24469
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/GoogleSpreadsheetWorksheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class GoogleSpreadsheetWorksheet {

const response = await this._spreadsheet.axios.request({
method: 'post',
url: `/values/${this.encodedA1SheetName}:append`,
url: `/values/${this.encodedA1SheetName}!A1:append`,
params: {
valueInputOption: options.raw ? 'RAW' : 'USER_ENTERED',
insertDataOption: options.insert ? 'INSERT_ROWS' : 'OVERWRITE',
Expand Down
3 changes: 2 additions & 1 deletion test/rows.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ let sheet;
let rows;
let row;

const HEADERS = ['numbers', 'letters', 'col1', 'col2', 'col3'];
// having some issues caused by blank headers, so we add one here
const HEADERS = ['numbers', 'letters', '', 'col1', 'col2', 'col3'];
const INITIAL_ROW_COUNT = 15;
const INITIAL_DATA = [
['0', 'A'],
Expand Down

0 comments on commit 5c24469

Please sign in to comment.