问题描述
我正在尝试让某个表格的最后一行与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
相关
- Google Script checking that the data within one column on one sheet is the same as another column in another sheet
- How do I find the cell with a certain background color,and set background of different cell in relation to it?
- How to set a variable based on other variables
- I'm trying to make an id searcher which does a thing when you input the right id. However,the if statement always runs. Why is this?