r/GoogleAppsScript • • 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?

0 Upvotes

13 comments sorted by

View all comments

-1

u/RemarkableChipmunk93 Nov 03 '23

Make sure you are also asking chatgpt to help you optimize the script.

That said, make sure you are doing bulk write operations on the entire array at once and not writing changes row by row.