I am using google script editor to automate a hiring chart that allows different tasks complete (ex. creation of email account) to trigger an email to the next person to complete their task (ex. adding them to payroll)
I am using the triggerOnEdit(e)
function along with the var rang = e.range;
to get the active row the changes took place on the sheet and defining the column for each task.
My current issue is I am trying to use an OR statement to allow an email to be sent to the same person depending on what building is defined in the building column.
function buildingEmail(e)
{
var range2 = e.range;
var row2 = range2.getRow();
var building2 = SpreadsheetApp.getActiveSheet().getRange(row2,3).getValue();
//var building = SpreadsheetApp.getActiveSheet().getRange(30,3).getValue();
if(building2 == ('building 1'||'building 2'))
{
//SpreadsheetApp.getUi().alert("Email sent to building 1 Admin");
MailApp.sendEmail(prEmail,"New Staff Onboarding","A change has been made to the Onboarding Sheet that needs your attention. Please visit link to complete your task.");
return;
}
I am using ||
because in some google searches that seemed to be how to do an OR statement but that does not seem to be working. I have tried finding how to properly do it now but cannot seem to figure this out. Any assistance on this?
If I need to upload the entire script I can but if someone knows how to add in an OR statement I think the rest of it is working properly.