The target Google Spreadsheet ID to write data to (supporting %FILENAME% variable). The ID can be obtained from the browser's address bar, for example:
API
In addition to the commonly used file handling synchronous functions like api.files(), api.read(filename, encoding='utf8'), api.write(filename, text), and api.remove(filename), you can also use the synchronous function api.sheetNames() to retrieve an array of sheet titles from a spreadsheet:
// Print the titles of all the sheetsconsole.log(api.sheetNames())
// Create a new spreadsheet titled "new sheet"let header = ['Name','Email']let rows = [ {'Name':'Alice','Email':'alice@mail.com'}, {'Name':'Bob','Email':'bob@mail.com'}] awaitapi.addSheet(header, rows,'new sheet')// Delete a spreadsheet titled "old sheet"awaitapi.delSheet('old sheet')// Add several rows of data to a sheet with the title "new sheet"let rows2 = [{'Name':'Candy','Email':'candy@mail.com'}]awaitapi.addRows('new sheet', rows2)// Read the spreadsheet data titled "new sheet"let rows3 =awaitapi.getRows('new sheet')console.log(rows3)// Delete the third column, excluding the header column, and column count incrementing from 0awaitapi.delRow('new sheet',2) // row of 'Candy' will be deleted//Read a cell in a Google Spreadsheet, including the header row, with row count and column count incrementing from 0let cell =awaitapi.getCell('new sheet',2,0)console.log(cell) // 'Bob'// Write data to a cell in a Google Spreadsheet, including the header row, with row count and column count incrementing from 0awaitapi.setCell('new sheet',2,0,'Bob Wang')// Batch read and write cells and then save the changes in the range from A1 to E5 in a Google Spreadsheetlet sheet =awaitapi.loadSheet('sheet1','A1:E5')let cell1 =awaitsheet.cell(0,1)cell1.value ='Jerry'let cell2 =awaitsheet.cell(1,1)cell2.value ='New Taipei City'awaitsheet.save()
--
We are dedicated to improving our content. Please let us know if you come across any errors, including spelling, grammar, or other mistakes, as your feedback is valuable to us! 🤖️⚡️