I have values in an array which are:
[8:00 AM, 9:00 AM] //result of another function
And I would like to find their values inside this 2-Dimensional Array:
[
[8:00 AM],
[9:00 AM],
[10:00 AM],
[11:00 AM],
[12:00 NN],
[1:00 PM],
[2:00 PM],
[3:00 PM]
]
and change the their values "Not Available"
The array log are the values from google sheet using this code:
function testRow(){
var lookDate = "Aug 28, 2019";
var ss = SpreadsheetApp.openByUrl(url);
var ts = ss.getSheetByName("Time_Select");
var checkData = ts.getRange(1, 1, 1, ts.getLastColumn()).getDisplayValues()[0];
var index = checkData.indexOf(lookDate)+1;
var timeValues = ts.getRange(2, index, ts.getLastRow()-1, 1).getValues();
Logger.log(timeValues)
/*var checkSplit = dateValues.join().split(",");
var checkMe = checkSplit.indexOf(dataDisable[1]);
var timeValues = ts.getRange(checkMe, index).getValue();*/
}
I tried to use this code (as you can see in the above google script code):
var checkSplit = dateValues.join().split(",");
var checkMe = checkSplit.indexOf(dataDisable[1]);
var timeValues = ts.getRange(checkMe, index).getValue();
but it was giving me a wrong value. Do you have any suggestions or solutions on how can I search the values inside the 2 dimensional array then go to its location in google sheet and change its value to "Not Available"? Thank you very much in advance for the help.
here is the link for my google sheet: https://docs.google.com/spreadsheets/d/1lEfzjG1zzJVPMN8r-OpeZm6q9_IqSwk9DNCEY-q7ozY/edit?usp=sharing