Custom File Properties

You can use Drive API to add your own properties to a Drive file. These properties are stored as key/value pairs on the Drive file. Properties may be visible to all apps, or restricted to the app that creates the property. Properties are accessed using the properties (visible to all apps) and appProperties (restricted to single apps) fields on files

Properties can also be used in search expressions.

Using properties will allow your app to store additional metadata on a file, such as tags, IDs from other data stores, viewing preferences etc. Properties can be used to share metadata between applications, for example, in a workflow application.

This is the structure of a typical property that might be used to store your database's ID for a Drive file on the file itself.

"appProperties": {
  "additionalID": "8e8aceg2af2ge72e78",

Custom properties have the following usage limits:

  • Maximum of 100 custom properties per file, totaled from all sources.
  • Maximum of 30 public properties per file, totaled from all sources.
  • Maximum of 30 private properties per file from any one application.
  • Maximum of 124 bytes size per property (including both key and value) string in UTF-8 encoding. For example, a property with a key that is ten characters long can only have 114 characters in the value. A property that requires 100 characters for the value can use up to 24 characters for the key.
  • Writing a file property has the same performance implications as other write operations.

For more information, see files in the reference documentation.

Send feedback about...