Change My Code From Variable To Array
I have a beautiful set of code provided from one of the best community member. What this code does is it reads a cell value from Google spreadsheet and then automatically check th
Solution 1:
To read ranges you need to use the range's getValues()
method, not getValue()
; getValue
returns the top leftmost cell's contents.
getValues()
will return an array of rows. Each row being an array of cells within that row.
Be aware that it returns an array of arrays, even if it's just one column wide or one row high.
So if you want an array you can
var match1 = sheet.getRange("B2").getValues().map(function(row) {return row[0]});
In the script try
google.script.run.withSuccessHandler(checkDefault).getValues().forEach(checkDefault);
Post a Comment for "Change My Code From Variable To Array"