Google sheets 需要在google工作表中使用append函数
我正在尝试从一张工作表中提取数据并将其写入另一张工作表。我希望附加目标工作表,以便在目标单元格中填充数据。如果我理解正确,并且您希望将数据附加到目标工作表中,您可以尝试 函数readDataFromRange(){ //从范围选项链读取数据-漂亮!D1:G1 const ss=SpreadsheetApp.getActive(); const data=ss.getRange(“选项链-NIFTY!D1:G1”).getValues().flat(); //记录读取的数据。 Logger.log(JSON.stringify(data)); //将数据附加到工作表“GRAPHDATA” ss.getSheetByName(“GRAPHDATA”).appendRow(数据)Google sheets 需要在google工作表中使用append函数,google-sheets,Google Sheets,我正在尝试从一张工作表中提取数据并将其写入另一张工作表。我希望附加目标工作表,以便在目标单元格中填充数据。如果我理解正确,并且您希望将数据附加到目标工作表中,您可以尝试 函数readDataFromRange(){ //从范围选项链读取数据-漂亮!D1:G1 const ss=SpreadsheetApp.getActive(); const data=ss.getRange(“选项链-NIFTY!D1:G1”).getValues().flat(); //记录读取的数据。 Logger.lo
}我尝试编写代码,但没有成功。脚本运行了,但在GRAPHDATA表中没有输出。您能否共享一份电子表格副本(敏感数据已擦除),以便我可以仔细查看?
function readDataFromRange() {
//Read data from the range OPTION CHAIN - NIFTY!D1:G1
var data = SpreadsheetApp.getActive().getRange("OPTION CHAIN - NIFTY!D1:G1").getValues();
//Log the data that was read.
Logger.log(JSON.stringify(data));
//Write the data to the range A1:D1 in Sheet "GRAPHDATA"
SpreadsheetApp.getActive().getRange("GRAPHDATA!A1:D1").setValues(data);
//apennd the rows
}