Can we sort google drive files to show the newest or last modified ones on the top ?? I only can see the list and grid option for showing files in iframe. If not , any advice or alternative solution for this issue that my client is facing it ?
1 Answers
Here is the documentation you needed to list files from the drive.
This method accepts the q parameter, which is a search query combining one or more search terms. For more information, see the Search for Files and Team Drives guide.
And you can actually sort it by using the parameter orderBy
.
A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.
You can also test by Try it now.

- 5,887
- 1
- 27
- 65