I am working with an array containing the values:
[8:00 AM, 9:00 AM] //result of another function
My goal is to locate these values within a 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 then update them to "Not Available"
The values in the array are retrieved from a Google Sheet using this script:
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 attempted using this code (as shown above in the Google Script):
var checkSplit = dateValues.join().split(",");
var checkMe = checkSplit.indexOf(dataDisable[1]);
var timeValues = ts.getRange(checkMe, index).getValue();
but it did not give me the correct result. Do you have any suggestions or solutions on how I can search for values within the 2-dimensional array, find their location in the Google Sheet, and change the value to "Not Available"? Thank you in advance for your assistance.
here is the link for my google sheet: https://docs.google.com/spreadsheets/d/1lEfzjG1zzJVPMN8r-OpeZm6q9_IqSwk9DNCEY-q7ozY/edit?usp=sharing