Google电子表格apis:使用工作区在特定工作表中添加/更新行的API

问题描述:

我正在寻找其他API,可以在特定工作表中添加/更新行。 V4版本的其余API采用spreadsheetID并在默认(第一个)工作表中添加该行。但是,我想编写一个脚本以使用worksheetID在工作表中添加/更新一行。Google电子表格apis:使用工作区在特定工作表中添加/更新行的API

请帮助 感谢,

+0

据我所知,它使用worksheetID只有名称或位置是不可能的。 –

不知道,如果你发现你的答案,但你可以更新/插入特定文档的电子表格。

首先获得有关文件

const GoogleSpreadsheet = require('google-spreadsheet'); 
const doc = new GoogleSpreadsheet(spreadsheetKey);  
const info = await Promise.promisify(doc.getInfo)(); 

的信息之后就可以办理所有的清单和更新自己。

const sheetName = "your name of the sheet"  
for (let sheet of info.worksheets) {    
     if(sheet.title === sheetName){ 
      //do the rest of addRow etc. 
     } 
    } 

有一个愉快的一天