MCC Keyword Performance: Cannot retrieve the next object: iterator has reached the end.

240 views
Skip to first unread message

Tina Arnoldi

unread,
Mar 20, 2017, 9:59:46 PM3/20/17
to AdWords Scripts Forum
This question has been asked before, but I am posting a new one because I really need someone to explain it to me like I'm a 5-year old. 


I've updated the G. Drive folder name, copied the template, and entered my email.

My error is:  Cannot retrieve the next object: iterator has reached the end. (line 84)

This is line 84

var rootFolder = DriveApp.getFoldersByName(ROOT_FOLDER_NAME).next();

I appreciate input from people who have patience and are kind to newcomers.

Vincent Racaza (AdWords Scripts Team)

unread,
Mar 21, 2017, 12:21:59 AM3/21/17
to AdWords Scripts Forum
Hi Tina,

No worries. We are here to help as much as we can.

The "Cannot retrieve the next object" error happens when you are using the next() method in an iterator and there is no object to fetch. In your case, it seems that the Google Drive folder name specified in the ROOT_FOLDER_NAME variable is not existing. Could you double check on your end if this folder is existing in the root directory?

If the issue still persists on your end, please provide your CID and the name of the script (Reply privately to author) so I could further investigate.

Thanks,
Vincent Racaza
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages