I'm learning how to query the YouTube API with apps script by following this
CodePudding user response:
Try changing:
var rowStart = (i*50) 2
To:
var rowStart = activeSheet.getLastRow() 1
Explanation:
For the rowStart you are multiplying the index by 50 but some results being returned for the items in your array are not exactly 50, therefore causing these blank rows. So changing this to getLastRow() will make it work to whatever the size of your array will be.
Total = 243 items You'll have 7 blank rows if you multiply by 50