Workaround: createdDate cannot be used with searchFiles of DriveApp in Google Apps Script
Unfortunately, in the current stage, in order to retrieve the file list using the created date, the search query of createdDate cannot be used with searchFiles method of DriveApp in Google Apps Script. This has already been reported at this issue tracker In this post, I would like to introduce a workaround for searching the files using the created date.
Issue and workaround
-
The parameter of “searchFiles” method of
DriveAppuses the search query for Drive API v2. When I testedcreatedDate > '####-##-##'for “searchFiles” and “Files: list” of Drive API v2, I confirmed errors likeInvalid argument: qandInvalid queryoccurred, respectively.