Hi I'm trying to get a script that will run some code for each name on a list created from my 'sheet1' column 'A2:A'
1. get the list from Column A2:A
2. run code for each name from the list
Here's my code but it's not working properly I don't think the array is populating properly
function test(){
var sheet = SpreadsheetApp.getActive().getSheetByName('sheet1');
var list = sheet.getRange('A2:A').getValues();
var a = [list];
a.forEach(function(entry) {
//do something
});
}
getRange(2,1,sheet.getLastRow()-1).getValues()or as some dogetRange('A2:A' + sheet.getLastRow()).getValues()not providing a numerical value to the last part often generates null all the way down to maxrows. Some people filter it out with.filter(e=>return e);which utilizes the falsyness of e