Javascript 在Google应用程序脚本中返回多个参数值
我目前正在构建一个表单,其中包含一个模态/侧边栏。我的问题是,我确实需要从*.gs文件中的函数传递多个值 目前我知道我可以实现这一点:Javascript 在Google应用程序脚本中返回多个参数值,javascript,google-apps-script,google-sheets,google-spreadsheet-api,Javascript,Google Apps Script,Google Sheets,Google Spreadsheet Api,我目前正在构建一个表单,其中包含一个模态/侧边栏。我的问题是,我确实需要从*.gs文件中的函数传递多个值 目前我知道我可以实现这一点: google.script.run.withSuccessHandler(myFunction).gasFunction('argument value'); Index.html 因此,为了返回所需的所有参数,我正在多次运行一个连续方法 google.script.run.withSuccessHandler(indexLog).logMe('value 1
google.script.run.withSuccessHandler(myFunction).gasFunction('argument value');
Index.html
因此,为了返回所需的所有参数,我正在多次运行一个连续方法
google.script.run.withSuccessHandler(indexLog).logMe('value 1');
google.script.run.withSuccessHandler(indexLog).logMe('value 2');
google.script.run.withSuccessHandler(indexLog).logMe('value 2');
我的值将是单元格引用,但我需要一个范围而不是单个单元格值
然后,我将获取这些值,并希望从这些值构建一个数组,以便在for循环函数中正确迭代这些值
提前谢谢 在方法的细节中 电子表格app.getActiveSheet().getRange(单元格).getValue()强>
function returnCellValue(cell) {
return (SpreadsheetApp.getActiveSheet().getRange(cell).getValue());
}
function returnCellValue(cell) {
return (SpreadsheetApp.getActiveSheet().getRange(cell).getValues());
}
即使输入了范围,也只返回1个值getValue()无论范围如何,只返回1个值
电子表格app.getActiveSheet().getRange(单元格).getValues()强>
function returnCellValue(cell) {
return (SpreadsheetApp.getActiveSheet().getRange(cell).getValue());
}
function returnCellValue(cell) {
return (SpreadsheetApp.getActiveSheet().getRange(cell).getValues());
}
使用getValues()将范围作为数组传递,然后我可以对其进行迭代。目前,Google应用程序脚本和工作表仅支持触摸单元格的范围,因此,如果所需范围不是所引用单元格的相邻区域,则不能使用逗号分隔符来定义所有范围