Title1

Title2

Title3

4-3 得到Google表單的值

 

//Line權杖
var token = "Line權杖";
 
function getFormData(e) {
  var ss = SpreadsheetApp.getActive();
  var ws = ss.getActiveSheet();
  var title = ws.getRange(1, 1, 1, ws.getLastColumn()).getValues()[0];//取得表單中文欄名
  var message = "\n\n";
  var data = {};
  for(i in title){
    message += title[i] + ":" + e.values[i] + "\n\n";
    data[title[i]] = e.values[i];
  }
  //通知Line
  sendLineNotify(message);  
   
  //通知日曆 
  //時間戳記  電子郵件地址  繳費單位  繳費日期  繳費金額  其他
   
  var title = data['繳費單位'] + "-" + data['繳費金額']; //日曆標題
  var startDate = data['繳費日期'];//日期
  var description = data['繳費單位'] + "-" + data['繳費日期'] + "-" + data['繳費金額'];//日曆內容  
  var color = 11;
  setCalendar(title, startDate, description, color);
   
}