Take the 2-minute tour ×

How do I get getFiles() to fetch ALL the files in the folder in Google Drive. right now it only fetches the top 250 files and stops.

var files = DocsList.getFolder('Mendeley Desktop').getFiles();

share|improve this question

2 Answers 2

up vote 1 down vote accepted

DocsList.DEFAULT_RESULT_SIZE is currently 250, so by default, you'll get a maximum of 250 results as a response from getFiles().

If you need more results, you can use the other getFiles() method, getFiles(start, max) to get up to DocsList.MAX_RESULT_SIZE (currently 500) results at once, and use it with an offset to get the next DocsList.MAX_RESULT_SIZE files.

share|improve this answer
So I have to iterate 8 times with 500 items at a time untill it fetches all 4000 items. –  MySchizoBuddy Nov 3 '12 at 22:25

This is how it works... to get the remaining items you should use method getFiles(start, max) as explained in the documentation

share|improve this answer

Your Answer


