Does anyone know where to find a good example of using the Google Sheets API to write to a google sheet? I've used https://developers.google.com/sheets/api/quickstart/nodejs, and was successfully to able to read from a Google Sheets, but am having trouble figuring out how to write to a Google Sheets.
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Why is `node.js` dying when called from inside pyt
- How to verify laravel passport api token in node /
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
The below works for me, assuming you have already gotten an authorized oAuth2Client.
Sheets API has sample with regard to Writing a single range on google sheets. There are concepts you must understand though like A1 Notation.
Aside from the samples from the guide, I also wrote JS codes to demonstrate writing on sheets on this SO thread. This will be helpful as NodejS uses JS too.
Yes, I have also read noogui's references: it will take some time before you have a finished program.
But I have succeeded in doing the following functions:
I needed to insert: temp, humidity and pressure in a row and in combination delete the oldest row (row 1). I placed these two functions in the same line where listMajors(...) was originally (in quickstart, js). And then put it into a loop: Bad idea: The functions are asynchronous so you do not know when one is finished and the other begins, A
console.log()
print showed:So sometimes appedData() and deleteRow() in real order, sometimes two or more times appedData() in order And other times two or more times deleteRow() in order.
I therefore changed quickstart.js to synchronous function instead of asynchronous: I removed callbacks of replaced
fs.readFile
withfs.readFileSync
, And it seems to work