iT邦幫忙

0

[已完成] Google App Script 讀取 Google 試算表內的值加以判斷,透過Line Notify 通知

  • 分享至 

  • xImage

https://ithelp.ithome.com.tw/upload/images/20220829/20055706UxB9DmoEVs.png

function goGet(e) {
  var token = "xxx";
  var url = "xxx";
  var sheet = "xxx";
  var SpreadSheet = SpreadsheetApp.openByUrl(url);
  var SheetName = SpreadSheet.getSheetByName(sheet);
  var lastColumn = SheetName.getLastColumn();
  var lastRow = SheetName.getLastRow();
  var SheetRange = SheetName.getSheetValues(1, 1, lastRow, lastColumn);
  Logger.log(SheetRange)
  var SheetData=[];
    for(var i = 1; i < SheetRange.length; i++) {
      var dataRow=SheetRange[i];
      var record = {};
      record['End Date'] = dataRow[0];
      record['All Day Event'] = dataRow[1];
      record['Last Day'] = dataRow[2];
      SheetData.push(record);
      }
    Logger.log(SheetData)
}
function sendLineNotify(message, token){
  var options =
   {
     "method"  : "post",
     "payload" : {"message" : message},
     "headers" : {"Authorization" : "Bearer " + token}
   };
   UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options);
}

https://ithelp.ithome.com.tw/upload/images/20220829/200557068bcYePHR9A.png

建立這個表格,我想撈出C欄位的值,若數字小於10,就會印出A 、 B、 C 欄位,
並透過Line Notify 通知,但目前我會把所有資料列出,但不知道怎麼索取裡面的值,且列出的值,也沒有像表格一樣的順序排列,請求大大協助

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答