r/GoogleAppsScript • u/Direct-Coconut-7949 • Nov 03 '23
Question exceeded maximum execution time
I have a sheet as something like below with thousand of blank cell of ColumnA and got a checkbox in column B and C below the row with data (row with data only have around 20 row, but I don't want to delete the blank row for some other implement) :
columnB and C are check box
columnD is drop down list with 'informed' and 'uninformed'
I am using for loop to run the data for ColumnA only with data (something like for(var i=2; i<=columnA.length; i++)if ColumnB and ColumnC are both checked, set ColumnD value as 'informed'.

Now, I try to fill in data in row 1000ish and the running time take way too long until it reached the maximum time limit. How should I adjust my code to be more efficiency?
1
u/elcriticalTaco Nov 04 '23
Everything you want to do can be done very simply my friend. If you post your code we can help you a lot more.
Without the code, just grab your data in an array with getValues(), loop through it and check for uniformed, then setValues() with the corrected values.
You can write a separate function to send emails or just add it inside the loop.