Search code examples
google-apps-scriptgoogle-drive-api

How to search files in the drive that are created within a week period?


How to search files in the drive that are created within a week? Currently, the search function search files by modified date/time and not created date/time.


Solution

  • You can search or filter files with the files.list methods of the Drive API. Use the 'orderBy' parameter and 'createdDate' as valid key.

    Example: orderBy=createdDate

    For more information regarding file request, please follow this link: https://developers.google.com/drive/v2/reference/files/list