尝试在Google脚本中运行两个功能和两个不同的电子邮件

问题描述

我正在尝试让某个表格的最后一行与Google表单提供表格后的if语句匹配的if语句触发我的表格触发电子邮件警报。它第一次工作,但当我尝试做第二个条件时,它只能完成第二个条件。因此将ifs工作分开,但不合并。

你们能帮忙吗?这是函数

function sendEmails() {
  
  var ss  = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Observaciones Diarias IMPRG");
  var lr  = ss.getLastRow();
  
  var currentTemp = ss.getRange(lr,6).getValue();
  var currentkidName = ss.getRange(lr,3).getValue();
  var currentTexture = ss.getRange(lr,15).getValue();
  
  if(currentTemp >39) {
  
  MailApp.sendEmail("xxx25@gmail.com","Temperature>39°Alert",currentkidName + " had atemperature of " + currentTemp + "° " +" which is extremely high,please check")
  }
  
  else if (currentTexture = 1){
    MailApp.sendEmail("xxx@gmail.com","Texture Alert",currentkidName + " had a  " + " liquid Evacuation. which indicates an issue,please check")
  }
}

解决方法

ConnectionIdentifier : ffff8a0133d5b010-0 InitiatorAddress : 0.0.0.0 InitiatorPortNumber : 194 TargetAddress : 10.0.0.254 TargetPortNumber : 3260 PSComputerName : 表示currentTexture = 1为1。做比较使用

currentTexture

currentTexture == 1

相关