Stay organized with collections Save and categorize content based on your preferences.
The advanced Drive service lets you use the Google Drive API in Apps Script. Much like Apps Script's built-in Drive service, this API allows scripts to create, find, and modify files and folders in Google Drive. In most cases, the built-in service is easier to use, but this advanced service provides a few extra features, including access to custom file properties as well as revisions for files and folders.
Note: This is an advanced service that must be enabled before use. ReferenceFor detailed information on this service, see the reference documentation for the Google Drive API. Like all advanced services in Apps Script, the advanced Drive service uses the same objects, methods, and parameters as the public API. For more information, see How method signatures are determined.
To report issues and find other support, see the Drive API support guide.
Sample codeThe code samples in this section use version 3 of the API.
Upload filesThe following code sample shows how to save a file to a user's Drive.
List foldersThe following code sample shows how to list the top-level folders in the user's Drive. Note the use of page tokens to access the full list of results.
List revisionsThe following code sample shows how to list the revisions for a given file. Note that some files can have several revisions and you should use page tokens to access the full list of results.
Add file propertiesThe following code sample uses the appProperties
field to add a custom property to a file. The custom property is only visible to the script. To add a custom property to the file that's also visible to other apps, use the properties
field, instead. For more information, see Add custom file properties.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-04 UTC."],[[["The advanced Drive service in Apps Script provides more features than the built-in service, like access to custom file properties and revisions."],["This advanced service requires enabling before use and mirrors the functionality of the Google Drive API."],["Code samples demonstrate how to upload files, list folders and revisions, and add custom properties to files in Google Drive using this service."],["The provided samples utilize version 3 of the Google Drive API and illustrate common Drive operations within Apps Script."],["For comprehensive details, refer to the Google Drive API reference documentation and support guide."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4