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

to add datas to last row directly #97

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Load a spreadsheet:

// Choose from 1 of the 5 authentication methods:

// 1. Username and Password has been deprecated. OAuth2 is recommended.
// 1. Username and Password has been deprecated. OAuth2 is recommended.

// OR 2. OAuth
oauth : {
Expand Down Expand Up @@ -99,7 +99,7 @@ Get metadata
``` js
function sheetReady(err, spreadsheet) {
if(err) throw err;

spreadsheet.metadata(function(err, metadata){
if(err) throw err;
console.log(metadata);
Expand All @@ -113,7 +113,7 @@ Set metadata
``` js
function sheetReady(err, spreadsheet) {
if(err) throw err;

spreadsheet.metadata({
title: 'Sheet2'
rowCount: 100,
Expand Down Expand Up @@ -252,6 +252,20 @@ Return text values for cells or return values as typed. (default: `true`)
* Q: How do I append rows to my spreadsheet ?
* A: Using the `info` object returned from `receive()`, one could always begin `add()`ing at the `lastRow + 1`, thereby appending to the spreadsheet.

```javascript
spreadsheet.receive((err, rows, info) => {
if (err) {
throw err;
}

spreadsheet.addVal('your_value', info.nextRow, columnNumber); //using addVal() directly

spreadsheet.send(function(err) {
if(err) throw err;
});
});
```

#### Credits

Thanks to `googleclientlogin` for easy Google API ClientLogin Tokens
Expand Down