AdsApp.​SearchRowIterator

Represents an iterator of report rows.

Typical usage:

 var rows = report.rows();
 while (rows.hasNext()) {
   var row = rows.next();
 }
Related:

Methods:

MemberTypeDescription
hasNext boolean Returns true if the search has more rows.
next Object Returns the next row in the search.

hasNext()

Returns true if the search has more rows.

Return values:

TypeDescription
boolean true if the search has more rows.

next()

Returns the next row in the search.

Search rows are returned as plain Javascript objects. Individual requested fields can be accessed by accessing the nested field.

 var rows = AdsApp.search(
     'SELECT search_term_view.search_term, metrics.ctr ' +
     'FROM   search_term_view ' +
     'WHERE  segments.date BETWEEN "2013-01-01" AND "2013-03-01"');

 while (rows.hasNext()) {
   var row = rows.next();
   var searchTerm = row['search_term_view'];
   var query = searchTerm['search_term'];
   var ctr = row['metrics']['ctr'];
 }

Return values:

TypeDescription
Object The next row in the search query.