Drive ToolboxDrive Toolbox
Features

Advanced File Filtering

Overview

At the heart of Drive Toolbox, a powerful file filtering system allows you to find and list a precise set of files from your Google Drive. And with that list, you can great things. Batch delete the files you want to get rid of. Add custom labels to organize your files. Remove, add, or change file permissions. Make public files private. Make private file public. Download matching files.

You do not actually have to learn the filter language to use the filtering system

It's powerful, but it's easy too. Drive Toolbox has three nifty tools you can use to create filters without learning the filtering language we've created.

(1) There's a natural language processor you can use to generate your filter with a prompt - just like you would do with a chatbot.

(2) There's a Visual Filter Builder that you can use to build filter conditions - and it's also a great way to learn how they work (probably more useful than this guide!)

(3) You can also generate common "Quick Filters" with a click, and edit them as needed.

What can you do with filters?

  • Find files by name, size, type, or date - and many other criteria
  • Locate files shared with specific people or publicly
  • Search by file owner or modification date
  • Combine multiple criteria with AND, OR, and NOT
  • Save frequently-used filters
  • Apply filters before batch operations (download, delete, label)
  • Apply filters only within a particular folder tree (e.g., find files labeled important in /My Drive/Clients/Rogers)

Basic Syntax

Filters use a simple format:

field:operation:value

Examples:

name:contains:report           # Files with "report" in the name
size:gt:10MB                   # Files larger than 10 MB
recently:modified:7d           # Modified in the last 7 days

There are also some nicknames that don't follow this field:operation:value convention, just for convenience. So you will see, for example:

is:folder

which is a convenient way to say that the file type is a Google Drive folder; the long way to write that is:

mime_type:equals:application/vnd.google-apps.folder 

If you don't see expected results, make sure your Drive is synced to Drive Toolbox, then double-check your filters.

Important rules:

  1. Separate field, operation, and value with colons (:)
  2. Use UPPERCASE for logical operators: AND, OR, NOT
  3. Quote values with spaces: name:contains:"Q1 Report"
  4. Group conditions with parentheses: (A OR B) AND C

If you do not group your conditions with parentheses we follow the standard order of precedence for logical operators, evaluating NOT first, then AND, and finally OR.


Operations

Operations determine how the filter matches values. Different types of fields support different operations.

String Operations

String operations are used to filter files based on text values, such as the name of the file or the owner's email address.

OperationAliasesDescriptionExample
equalseqExact match (case-insensitive for name)name:equals:Budget.xlsx
contains-Substring matchname:contains:report
startswithstarts_withStarts with valuename:startswith:2024
endswithends_withEnds with valuename:endswith:.pdf

Example queries:

name:contains:budget                    # Any file with "budget" in the name
owner_email:equals:elias@example.com     # Files owned by Elias
name:endswith:.pdf                      # All PDF files

Use quotes if there are spaces in a text value:

name:contains:"march presentation"      # Any file with "march presentation" in the name

Numeric Operations

Numeric operations are used to filter files based on numbers, such as file size in bytes.

OperationAliasesDescriptionExample
gtgreater_thanGreater thansize:gt:10485760
ltless_thanLess thansize:lt:1000000
gteGreater than or equalsize:gte:1048576
lteLess than or equalsize:lte:5242880

Example queries:

size:gt:104857600                       # Files larger than 100 MB
size:lt:1024                            # Files smaller than 1 KB

Size Nicknames:

You can also use KB, MB, and GB as nicknames, and the filter will parse them properly:

size:gt:100MB    # Files larger than 100 MB (100 * 1024 * 1024 bytes)
size:lt:1KB      # Files smaller than 1 KB (1024 bytes)

Time Operations

Time operations are used to filter files based on dates and times, such as when a file was created, modified, or viewed.

OperationDescriptionExample
sinceAfter this time (inclusive)modified_time:since:7d
beforeBefore this time (exclusive)created_time:before:2024-01-01

Time formats:

  1. Relative time:

    • 7d = 7 days ago
    • 1w = 1 week ago
    • 30d = 30 days ago
    • 6h = 6 hours ago
    • 1y = 1 year ago
  2. Keywords:

    • now, today, yesterday, this_week, last_week
  3. Absolute dates:

    • 2024-01-01 (date only)
    • 2024-01-01T12:00:00Z (date and time)

Example queries:

modified_time:since:7d                  # Modified in the last week
created_time:before:2024-01-01          # Created before 2024
viewed_by_me_time:since:today           # Viewed today

Special Operations

Special operations check whether a field has a value or is empty.

OperationAliasesDescriptionExample
exists-Field has a value (not NULL)viewed_by_me_time:exists
isnullis_nullField is NULL or emptyshared_with_me_time:isnull

Example queries:

viewed_by_me_time:exists                # Files you have viewed
parent_folder_id:isnull                 # Files with no parent folder

Logical Operators

Combine multiple filter conditions using logical operators to create powerful queries.

AND - All conditions must match

Use AND when you want files that match all criteria.

is:file AND name:contains:report
size:gt:1000000 AND mime_type:contains:pdf

OR - At least one condition must match

Use OR when you want files that match any of the criteria.

name:contains:doc OR name:contains:pdf
is:folder OR size:gt:10485760

NOT - Negates a condition

Use NOT to exclude files that match a criteria.

NOT is:folder
is:file AND NOT mime_type:contains:image

Parentheses - Group conditions

Use parentheses () to control the order of operations.

(name:contains:doc OR name:contains:pdf) AND is:file
is:file AND NOT (label:archived OR label:deleted)

Operator precedence (highest to lowest):

  1. NOT
  2. AND
  3. OR

Shortcuts

Shortcuts provide convenient syntax for common queries.

is: Shortcut

Quickly filter by file type.

ShortcutDescriptionExample
is:folderShow only foldersis:folder
is:fileShow only files (not folders)is:file AND size:gt:10485760
is:orphanedShow orphaned filesis:orphaned

recently: Shortcut

Quickly filter by recent activity.

ShortcutDescriptionExample
recently:modified:TIMEModified recentlyrecently:modified:7d
recently:viewed:TIMEViewed recentlyrecently:viewed:1w
recently:shared:TIMEShared with you recentlyrecently:shared:30d
recently:created:TIMECreated recentlyrecently:created:today

permissions: Shortcut

Quickly filter by sharing permissions.

ShortcutDescriptionExample
permissions:anyone:ROLEPublicly shared with rolepermissions:anyone:reader
permissions:type:TYPEPermission typepermissions:type:user

Common roles: reader, writer, commenter

Common types: user, group, domain, anyone

label: Shortcut

Quickly filter by custom labels.

label:important
label:project-alpha
label:"needs review"

Examples by Use Case

Finding Large Files

size:gt:100MB                           # Files larger than 100 MB
size:gt:1073741824                      # Files larger than 1 GB (1024 * 1024 * 1024 bytes)
mime_type:contains:pdf AND size:gt:1MB  # Large PDFs (greater than 1 MB)

Finding Old or Stale Files

modified_time:before:1y                 # Not modified in over a year
created_time:before:2020-01-01          # Created before 2020
size:gt:104857600 AND modified_time:before:1y  # Large, old files

Finding Files by Type

mime_type:contains:pdf                  # PDF files
mime_type:contains:image                # Images
mime_type:contains:video                # Videos
mime_type:contains:spreadsheet          # Google Sheets
mime_type:contains:document             # Google Docs

Finding Shared Files

permissions:anyone:reader               # Publicly readable files
permissions:type:user AND NOT owner_email:equals:me  # Shared with you
owner_email:contains:@example.com       # From a specific domain

Security Audits

permissions:anyone:writer               # Publicly writable files (dangerous!)
permissions:anyone:reader OR permissions:anyone:commenter  # All public files

Cleanup Operations

size:gt:104857600 AND modified_time:before:1y AND NOT owner_email:equals:me
# Large files (>100MB) not modified in a year that you don't own

is:orphaned AND created_time:since:7d
# Recently orphaned files

Complex Queries

(name:contains:"Q1 Report" OR name:contains:"Q2 Report") AND NOT (label:archived OR label:deleted) AND size:gt:1048576
# Q1 or Q2 reports, not archived or deleted, larger than 1 MB

(owner_name:contains:John OR owner_name:contains:Jane) AND recently:modified:30d
# Files owned by John or Jane, modified in the last 30 days

Common Patterns

  • Large files: size:gt:100MB
  • Recent activity: recently:modified:7d or recently:viewed:7d
  • Specific file types: mime_type:contains:TYPE where TYPE is pdf, image, video, document, spreadsheet
  • Folders only: is:folder
  • Files only: is:file
  • Shared publicly: permissions:anyone:reader
  • Not owned by me: NOT owner_email:equals:me
  • Old files: modified_time:before:1y
  • Labeled files: label:LABEL_NAME

Filter Expressions Reference

This is a comprehensive reference of all available filter fields. Use this when you need to look up specific field names or see what operations are supported.

Supported Fields

File Properties

Core file metadata including name, size, type, and timestamps

Basic Information

size Number
Unified size for files and folders. For files: uses actual file size. For folders: uses recursive size (sum of all files in folder tree). Supports suffixes: B, KB, MB, GB, TB (e.g., '10MB' = 10485760 bytes)
Operations: equals, gt, lt, gte, lte
Note: Supports KB, MB, GB suffixes
file_extension / extension String
File extension (e.g., 'pdf', 'jpg', 'docx'). Note: Google Workspace files (Docs, Sheets, etc.) have no extension.
Operations: equals, contains, startswith, endswith, isnull
Examples: pdf, jpg, png, ...
is_folder Boolean
Boolean field indicating whether the item is a folder (true) or a file (false)
Operations: equals
label String
User-defined labels assigned to files for organization and batch operations
Operations: equals, contains
mime_type / type String
MIME type of the file (e.g., 'application/pdf', 'image/jpeg', 'application/vnd.google-apps.folder')
Operations: equals, contains, startswith, endswith
Examples: application/pdf, application/vnd.google-apps.folder, application/vnd.google-apps.document, ...
name String
The name of the file or folder (case-insensitive)
Operations: equals, contains, startswith, endswith

Location & Hierarchy

descendant_of / in_folder String
Find files within a folder (recursively). Use a folder ID (e.g., 'abc123xyz') or path (e.g., '/My Drive/Projects').
Operations: equals
parent_folder_name String
Name of the parent folder (case-insensitive).
Operations: equals, contains, startswith, endswith, exists, isnull

Dates & Times

created_time Time
When the file was created. Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339)
Operations: since, before, gt, lt
modified_by_me_time Time
When I last modified the file. Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339)
Operations: since, before, gt, lt
modified_time Time
When the file was last modified. Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339)
Operations: since, before, gt, lt
trashed_time Time
When the file was moved to trash. Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339). Note: Most files won't have this field.
Operations: since, before, gt, lt, isnull
viewed_by_me_time Time
When the file was last viewed by the current user. Supports relative time (e.g., '2d', '1h') and absolute timestamps
Operations: since, before, gt, lt, exists, isnull

Permissions and Sharing

Sharing status, permission types, and ownership

is_shared Boolean
Boolean field indicating whether the file is shared with others (true) or private (false)
Operations: equals
owned_by_me / mine Boolean
Boolean field indicating whether the file is owned by the current user (true) or by someone else (false)
Operations: equals
owner_email String
Email address of the file owner. Use 'me' to refer to the current user.
Operations: equals, contains
Special: me = The current user's email address
owner_name String
Display name of the file owner (case-insensitive)
Operations: equals, contains, startswith, endswith
permissions_anyone String
Permission role for 'anyone' access (reader, writer, commenter, owner). Used to find publicly shared files.
Operations: equals
Values: reader, writer, commenter, owner
permissions_type String
Type of permission on the file: 'user' (specific person), 'group', 'domain', or 'anyone' (public)
Operations: equals
Values: user, group, domain, anyone
shared_with String
Who the file is shared with. Special values: 'true' (shared with anyone), 'false' (not shared), 'public' (publicly shared), or an email address.
Operations: equals, contains
Special: true = File is shared with anyone (has any permissions); false = File is NOT shared (has no permissions); public = File is publicly shared (anyone with link can access)
shared_with_me_time Time
When the file was shared with the current user. Supports relative time (e.g., '2d', '1h') and absolute timestamps
Operations: since, before, gt, lt, exists, isnull

Activity History

File Activity data elements, such as who edited a file and when. WARNING: This data is only populated if the user has enabled File Activity Queries in Settings; and only goes back a limited number of days, such as 180. Use file Properties instead whenever possible.

activity_last_activity_time Time
When any activity was last performed on the file (create, edit, move, share, etc.). Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339). Supports :for:actor:op:value to filter by specific actors. Examples: activity_last_activity_time:since:7d or activity_last_activity_time:since:7d:for:actor:equals:me. Requires activity tracking data.
Operations: since, before, gt, lt
activity_last_create_time Time
When the file was created. Supports :for:actor:op:value to filter by specific creators. Examples: activity_last_create_time:since:30d or activity_last_create_time:since:7d:for:actor:equals:me. Requires activity tracking data.
Operations: since, before, gt, lt
activity_last_edit_time Time
When the file was last edited. Supports :for:actor:op:value to filter by specific editors. Examples: activity_last_edit_time:since:7d or activity_last_edit_time:since:7d:for:actor:equals:me. Requires activity tracking data.
Operations: since, before, gt, lt
activity_last_move_time Time
When the file was last moved. Supports :for:actor:op:value to filter by who moved it. Examples: activity_last_move_time:since:7d or activity_last_move_time:since:7d:for:actor:equals:me. Requires activity tracking data.
Operations: since, before, gt, lt
activity_last_permission_change_time Time
When file permissions were last changed (sharing, access changes). Supports :for:actor:op:value to filter by who changed permissions. Examples: activity_last_permission_change_time:since:7d or activity_last_permission_change_time:since:7d:for:actor:equals:me. Requires activity tracking data.
Operations: since, before, gt, lt
activity_last_rename_time Time
When the file was last renamed. Supports :for:actor:op:value to filter by who renamed it. Examples: activity_last_rename_time:since:7d or activity_last_rename_time:since:7d:for:actor:equals:me. Requires activity tracking data.
Operations: since, before, gt, lt

File Capabilities

Actions you can perform on files (delete, share, download, edit, etc.)

can_change_copy_requires_writer_permission Boolean
Boolean field indicating whether you have permission to change copy restriction settings for this file
Operations: equals
can_copy Boolean
Boolean field indicating whether you have permission to make a copy of this file
Operations: equals
can_delete Boolean
Boolean field indicating whether you have permission to permanently delete this file
Operations: equals
can_delete_children Boolean
Boolean field indicating whether you have permission to delete contents of this folder
Operations: equals
can_download Boolean
Boolean field indicating whether you have permission to download this file
Operations: equals
can_edit Boolean
Boolean field indicating whether you have permission to edit this file online
Operations: equals
can_modify_content Boolean
Boolean field indicating whether you have permission to modify the file's content
Operations: equals
can_rename Boolean
Boolean field indicating whether you have permission to rename this file
Operations: equals
can_share Boolean
Boolean field indicating whether you have permission to share this file with others
Operations: equals
can_trash Boolean
Boolean field indicating whether you have permission to move this file to trash
Operations: equals

Uncommon Fields

Rarely-needed fields such as orphaned files and web links

description String
File description text. Use to search for specific content in file descriptions.
Operations: equals, contains, startswith, endswith, isnull
inaccessible_parent_folder_id String
Google Drive ID of the inaccessible parent folder (for orphaned files)
Operations: equals, contains, startswith, endswith, exists, isnull
is_orphaned Boolean
Whether the file is orphaned (parent folder is inaccessible or deleted)
Operations: equals
orphaned_at Time
When the file became orphaned. Supports relative time (e.g., '2d', '1h') and absolute timestamps
Operations: since, before, gt, lt, exists, isnull
orphaned_reason String
Reason why the file is orphaned (e.g., 'parent_deleted', 'permission_denied', 'parent_not_found')
Operations: equals, contains
Values: parent_deleted, permission_denied, parent_not_found, no_parent
parent_folder_id String
Google Drive ID of the parent folder.
Operations: equals, contains, startswith, endswith, exists, isnull
url / web_link String
URL to open the file in Google Drive web interface
Operations: equals, contains, startswith, endswith, exists, isnull

Common MIME Types

For use with mime_type:contains:VALUE:

TypeMIME Type Pattern
Folderapplication/vnd.google-apps.folder (or use is:folder)
Google Docapplication/vnd.google-apps.document
Google Sheetapplication/vnd.google-apps.spreadsheet
Google Slidesapplication/vnd.google-apps.presentation
PDFapplication/pdf (or just pdf)
Imagesimage
Videosvideo
Audioaudio
ZIPapplication/zip (or just zip)
Texttext

More about Activity Filters

Google Drive provides File Activity data, which you can optionally add to your Drive Toolbox and use in filters. This is data about who, what and when: who did something to one of my files, what did they do, and when did they do it. For example, if yvonne@example.com edited a document called Best tacos in LA on 1/26/2026 a 4:15 pm, that's info that appears in the File Activity data.

You can optionally choose to sync activity data. If you do not turn on the feature, there won't be any activity data synced to the Drive Toolbox database on your computer. You can turn it on, on the Settings page of the Desktop app.

Activity filters give you great information about recent activities, but Google does not provide an activity history all the way back to when you first created a file. So it's great if you want to see which of your files yvonne@example.com has edited in your Drive, in the past few months. But don't use it for questions like, "has this file been edited in the last 3 years?" In that case, rely on the file Properties filters, like recently:modified:3y. You can't see if it was Yvonne, though.

Extended syntax for activity filters:

Activity filters (like activity_last_edit_time, activity_last_create_time, activity_last_move_time) support an optional :for:actor clause to filter by who performed the action:

activity_last_edit_time:since:7d                                     # Files edited in last 7 days (by anyone)
activity_last_edit_time:since:7d:for:actor:equals:me                 # Files edited by YOU in last 7 days
activity_last_edit_time:since:2m:for:actor:equals:juno@example.com   # Files edited by juno@example.com
activity_last_create_time:since:30d:for:actor:contains:@example.com  # Files created by people with an email containing `@example.com`

Activity Data Limitations:

Activity filters rely on data from Google Drive's Activity API, which has important limitations:

  1. Retention Window: Activity data is retained for 90-180 days (configurable, Google's max is 180 days). Activities older than this window are not available.
  2. Permission Required: Drive Activity API read permission. If not granted, no activity data will be available to Drive Toolbox.
  3. Email Resolution: If the actor (the person who edited the file, for example) is not in your Contacts or in your Workspace, we won't know what their email is; instead Google provides an unhelpful alphanumerical identifier.
  4. One Filter Per Query: Only ONE activity filter (e.g., activity_last_edit_time) is allowed per query. You can combine it with other non-activity filters (size, name, etc.).
  5. Results Based on Available Data: Activity filters yield results based on the activity records available to Drive Toolbox. If no activity data is available, query results will be the same as for files that have actually had no activity.