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
importantin/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:
- Separate field, operation, and value with colons (
:) - Use UPPERCASE for logical operators:
AND,OR,NOT - Quote values with spaces:
name:contains:"Q1 Report" - 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.
| Operation | Aliases | Description | Example |
|---|---|---|---|
equals | eq | Exact match (case-insensitive for name) | name:equals:Budget.xlsx |
contains | - | Substring match | name:contains:report |
startswith | starts_with | Starts with value | name:startswith:2024 |
endswith | ends_with | Ends with value | name: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.
| Operation | Aliases | Description | Example |
|---|---|---|---|
gt | greater_than | Greater than | size:gt:10485760 |
lt | less_than | Less than | size:lt:1000000 |
gte | Greater than or equal | size:gte:1048576 | |
lte | Less than or equal | size: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.
| Operation | Description | Example |
|---|---|---|
since | After this time (inclusive) | modified_time:since:7d |
before | Before this time (exclusive) | created_time:before:2024-01-01 |
Time formats:
-
Relative time:
7d= 7 days ago1w= 1 week ago30d= 30 days ago6h= 6 hours ago1y= 1 year ago
-
Keywords:
now,today,yesterday,this_week,last_week
-
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.
| Operation | Aliases | Description | Example |
|---|---|---|---|
exists | - | Field has a value (not NULL) | viewed_by_me_time:exists |
isnull | is_null | Field is NULL or empty | shared_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):
NOTANDOR
Shortcuts
Shortcuts provide convenient syntax for common queries.
is: Shortcut
Quickly filter by file type.
| Shortcut | Description | Example |
|---|---|---|
is:folder | Show only folders | is:folder |
is:file | Show only files (not folders) | is:file AND size:gt:10485760 |
is:orphaned | Show orphaned files | is:orphaned |
recently: Shortcut
Quickly filter by recent activity.
| Shortcut | Description | Example |
|---|---|---|
recently:modified:TIME | Modified recently | recently:modified:7d |
recently:viewed:TIME | Viewed recently | recently:viewed:1w |
recently:shared:TIME | Shared with you recently | recently:shared:30d |
recently:created:TIME | Created recently | recently:created:today |
permissions: Shortcut
Quickly filter by sharing permissions.
| Shortcut | Description | Example |
|---|---|---|
permissions:anyone:ROLE | Publicly shared with role | permissions:anyone:reader |
permissions:type:TYPE | Permission type | permissions: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:7dorrecently:viewed:7d - Specific file types:
mime_type:contains:TYPEwhere 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) |
file_extension / extension String |
File extension (e.g., 'pdf', 'jpg', 'docx'). Note: Google Workspace files (Docs, Sheets, etc.) have no extension. |
is_folder Boolean |
Boolean field indicating whether the item is a folder (true) or a file (false) |
label String |
User-defined labels assigned to files for organization and batch operations |
mime_type / type String |
MIME type of the file (e.g., 'application/pdf', 'image/jpeg', 'application/vnd.google-apps.folder') |
name String |
The name of the file or folder (case-insensitive) |
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'). |
parent_folder_name String |
Name of the parent folder (case-insensitive). |
Dates & Times
created_time Time |
When the file was created. Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339) |
modified_by_me_time Time |
When I last modified the file. Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339) |
modified_time Time |
When the file was last modified. Supports relative time (e.g., '2d', '1h') and absolute timestamps (RFC3339) |
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. |
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 |
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) |
owned_by_me / mine Boolean |
Boolean field indicating whether the file is owned by the current user (true) or by someone else (false) |
owner_email String |
Email address of the file owner. Use 'me' to refer to the current user. |
owner_name String |
Display name of the file owner (case-insensitive) |
permissions_anyone String |
Permission role for 'anyone' access (reader, writer, commenter, owner). Used to find publicly shared files. |
permissions_type String |
Type of permission on the file: 'user' (specific person), 'group', 'domain', or 'anyone' (public) |
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. |
shared_with_me_time Time |
When the file was shared with the current user. Supports relative time (e.g., '2d', '1h') and absolute timestamps |
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. |
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. |
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. |
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. |
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. |
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. |
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 |
can_copy Boolean |
Boolean field indicating whether you have permission to make a copy of this file |
can_delete Boolean |
Boolean field indicating whether you have permission to permanently delete this file |
can_delete_children Boolean |
Boolean field indicating whether you have permission to delete contents of this folder |
can_download Boolean |
Boolean field indicating whether you have permission to download this file |
can_edit Boolean |
Boolean field indicating whether you have permission to edit this file online |
can_modify_content Boolean |
Boolean field indicating whether you have permission to modify the file's content |
can_rename Boolean |
Boolean field indicating whether you have permission to rename this file |
can_share Boolean |
Boolean field indicating whether you have permission to share this file with others |
can_trash Boolean |
Boolean field indicating whether you have permission to move this file to trash |
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. |
inaccessible_parent_folder_id String |
Google Drive ID of the inaccessible parent folder (for orphaned files) |
is_orphaned Boolean |
Whether the file is orphaned (parent folder is inaccessible or deleted) |
orphaned_at Time |
When the file became orphaned. Supports relative time (e.g., '2d', '1h') and absolute timestamps |
orphaned_reason String |
Reason why the file is orphaned (e.g., 'parent_deleted', 'permission_denied', 'parent_not_found') |
parent_folder_id String |
Google Drive ID of the parent folder. |
url / web_link String |
URL to open the file in Google Drive web interface |
Common MIME Types
For use with mime_type:contains:VALUE:
| Type | MIME Type Pattern |
|---|---|
| Folder | application/vnd.google-apps.folder (or use is:folder) |
| Google Doc | application/vnd.google-apps.document |
| Google Sheet | application/vnd.google-apps.spreadsheet |
| Google Slides | application/vnd.google-apps.presentation |
application/pdf (or just pdf) | |
| Images | image |
| Videos | video |
| Audio | audio |
| ZIP | application/zip (or just zip) |
| Text | text |
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:
- 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.
- Permission Required: Drive Activity API read permission. If not granted, no activity data will be available to Drive Toolbox.
- 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.
- 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.). - 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.