Learn how to add, update and search or query for custom Google Drive properties in file metadata in with Google Apps Script
Managing and searching for project files in Google Drive can be a challenge, especially when naming conventions are not followed. While Google’s Drive Labels API offers a solution, its use is often restricted to administrators, leaving many developers looking for a more accessible alternative.
Over on his blog, Yagisanatode, developer Scott Donald provides an in-depth tutorial on using custom file properties with Apps Script. This technique allows you to programme-matically attach your own searchable metadata—like a project ID, version number, or status—to any file in Drive.
The tutorial walks you through the entire process, including:
- Enabling the Drive API v3 advanced service.
- Using
Drive.Files.update()
to add properties to a file. - Crafting queries with
Drive.Files.list()
to find files based on your custom properties.
For developers working at scale, the tutorial also covers how to avoid slow, iterative updates. Scott introduces a powerful batch update method that uses UrlFetchApp
to efficiently modify thousands of files in a single request.
This is an excellent, practical guide for any intermediate developer looking to build more organised and robust file management systems in Google Drive.
Source: Add Custom Queryable Properties to Any File in Google Drive with Apps Script – Yagisanatode

Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.