Tony Nasr
Tony Nasr

Reputation: 11

the getFiles() isn't returning all files available

 var results = DriveApp.getFiles(start,max);

 while(results.hasNext()) {
  var result = results.next();
 }
 Logger.log("test");

This piece of code should find me all my files from my-drive but I only receive 5 files out of 7 - can anyone help ?

Upvotes: 0

Views: 682

Answers (1)

ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17651

This is how to return all files as instructed by the Apps Script docs:

// Log the name of every file in the user's Drive.
var files = DriveApp.getFiles();
while (files.hasNext()) {
  var file = files.next();
  Logger.log(file.getName());
}

Upvotes: 1

Related Questions