AdWords
1.5K members online now
1.5K members online now
Improve your AdWords performance and boost your ROI, CTR, and Quality Score
Guide Me
star_border
Reply

Cannot retrieve the next object: iterator has reached the end.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hey, I'm having a problem trying to use the Flexible Budget Scripts for my Video Pre Roll campaign.

Cannot retrieve the next object: iterator has reached the end. (line 53)

 

 

  var campaign = AdWordsApp.campaigns().
  withCondition('CampaignName = "'+ campaignName + '"')
      .get().
      next();

It seems to be working fine when I set the script for my Display, and SEM campaigns. Not sure why it wont recognize the next object. Please help!

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Dillon C
July 2016

Re: Cannot retrieve the next object: iterator has reached the end.

[ Edited ]
Top Contributor
# 2
Top Contributor

there likely is no next value.

currently, video-campaigns are not supported with respect to
adwords-scripts -- except in a limited way using reports-data.

any follow-up questions are likely best asked in the adwords-scripts forum:
https://groups.google.com/forum/#!forum/adwords-scripts

see also
https://developers.google.com/adwords/scripts/docs/limits

 

Logger.log(campaignName + "::" + AdWordsApp.campaigns().withCondition('CampaignName = "'+ campaignName + '"').get().hasNext());

function prcamps() {
	var camps = AdWordsApp.campaigns().get();
	Logger.log("total supported campaigns = " + camps.totalNumEntities());
	while(camps.hasNext()) {
		Logger.log("supported campaign: " + camps.next().getName());
	}
} // prcamps

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Dillon C
July 2016

Re: Cannot retrieve the next object: iterator has reached the end.

[ Edited ]
Top Contributor
# 2
Top Contributor

there likely is no next value.

currently, video-campaigns are not supported with respect to
adwords-scripts -- except in a limited way using reports-data.

any follow-up questions are likely best asked in the adwords-scripts forum:
https://groups.google.com/forum/#!forum/adwords-scripts

see also
https://developers.google.com/adwords/scripts/docs/limits

 

Logger.log(campaignName + "::" + AdWordsApp.campaigns().withCondition('CampaignName = "'+ campaignName + '"').get().hasNext());

function prcamps() {
	var camps = AdWordsApp.campaigns().get();
	Logger.log("total supported campaigns = " + camps.totalNumEntities());
	while(camps.hasNext()) {
		Logger.log("supported campaign: " + camps.next().getName());
	}
} // prcamps

Re: Cannot retrieve the next object: iterator has reached the end.

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks! I really appreciate the help.