比如說我的桌子看起來像這

uj5u.com熱心網友回復:
這是使用 for 回圈的@pgSystemTester 答案的替代方法。
function getFiltered() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const ws = ss.getActiveSheet();
var theValues = ws.getRange("a:b").getValues();
//Removes the header row
theValues = theValues.slice(1)
var breakfastValues = []
for (let i = 0; i < theValues.length; i ) {
if (theValues[i][0] === "Breakfast") {
breakfastValues.push(theValues[i][1]);
}
}
return breakfastValues
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/485789.html
