Most likely issue is value of variable rows is incorrect. Variable rows seems to be defined based on the amount of rows in array studentDT and that array is defined in a function called getDataValues which you have not shared of what it does.
Add a line above the error as follows to see what is the content of rows:
Logger.log(rows);
That should give you a view of what is the value of rows.
Alternatively, share with us the code which contains the function getDataValues so we can see how the data is filled in for any issues.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a04a71fd-196e-4ebc-952f-febd91390eban%40googlegroups.com.