[英]Autocomplete in Google Apps Script with data from Google Sheets
[英]How to get data from Google Sheets and handle them in Google Apps script?
在 Google 腳本編輯器中,當我想從 Google 表格中獲取數據范圍時,我使用以下示例行:
var value = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet name").getRange(row, column).getValues();
但這會返回“未定義”為 output。 例如,如果我使用
console.log(value)
或者如果我嘗試將“值”設置為 HTML 元素的值/文本/內容,例如文本框。 我期望得到一個包含指定范圍值的數組。 我做錯了什么,如何實現我的目標?
function handlingData() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName("Sheet0");
const vs = sh.getDataRange().getValues();
Logger.log(JSON.stringify(vs));
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.