I have written the following code:
function test() {
var spreadsheet = SpreadsheetApp.getActive();
var ui = SpreadsheetApp.getUi();
var testModeStatus = spreadsheet.getSheetByName("Students").getRange("P2:P2").getValues();
if (testModeStatus == 'FALSE') {
ui.alert("This is inside IF and Test Mode Status is "+testModeStatus);
};
ui.alert("This is outside IF and Test Mode Status is "+testModeStatus);
};
In the above code the variable testModeStatus refers to a sheet cell that is a checkbox and can have the value of either TRUE(checked) or FALSE(unchecked).
I want the code inside IF to run only when the checkbox is unchecked. But no matter if the checkbox is checked or unchecked, the code inside IF never Runs and in both cases just the code outside IF runs!! Moreover, in both cases the variable testModeStatus shows the correct value in the popping alert message. I mean if the checkbox is checked the variable shows TRUE and if it is unchecked the variable shows FALSE in the popping alert message.
Any help?
Aucun commentaire:
Enregistrer un commentaire