List User's Files/Folders
📖 Definition
The "List User's Files/Folders" action in the Google Workspace category allows you to search for and retrieve a list of files or folders that a specified user either owns or has access to in their Google Drive.
This action provides powerful filtering and sorting capabilities, enabling you to customize the search based on file name, type (files, folders, or both), shared drive inclusion, custom queries, ordering preferences, labels, and more.
It’s especially useful for automating file management tasks, auditing user storage, or building dynamic flows that need to work with user drive content.
Key capabilities include:
- Search across personal drives, shared drives, or the domain.
- Apply detailed filters like excluding trashed items or searching by labels.
- Fetch file metadata such as permissions, ownership, size, and links for easy automation.
- Handle large file sets using pagination (Next Page Tokens).
🎯Example Use Cases
📂 User File Audit
Quickly retrieve and review all the files and folders a user owns or has access to, ideal for compliance checks and audits.
🔎 Locate Important Documents
Search for specific documents by name across a user’s drive to find critical files like contracts, reports, or project assets.
🧹 Clean-Up Unused Files
Identify and list files that have not been modified for a long time to assist with storage management and drive clean-up processes.
🤝 Track Shared Files
Generate a list of files shared with others from a user's drive to monitor external sharing activity for security purposes.
📑 Build Dynamic Lists for Workflows
Automatically fetch and display available user files within a workflow, enabling users to select and take actions like copy, move, or delete.
📦 Backup Preparation
Collect a list of all user-owned files before account deactivation or offboarding for backup or transfer purposes.
📥 Inputs
Connection
Provide your Google Workspace Administration connection.
You must upload a credential JSON file for a service account with domain-wide delegation.
👉 See guide for creating the connection.
User Email
Enter the primary email address of the user whose files and folders you want to list.
This determines which user’s Google Drive will be searched.
File Name
Specify part or all of the file or folder name to search for.
Only items containing this value in their name will be included in the results.
Search For
Choose whether you want to search for Files, Folders, or Both.
This helps you filter results based on the type of item you are looking for.
Exclude Trashed Items
Select Yes to exclude items in the Trash, or No to include them.
Helps ensure you are working only with active, non-deleted files if desired.
Query
Enter a custom query to further filter search results.
Queries can be based on properties like owner, modified date, MIME type, etc., using Google Drive search syntax.
Include Items from Shared Drives
Check True if you want to include files from both My Drive and Shared Drives in the results.
(Default is False, which restricts search to My Drive only.)
Order By
Define how results should be sorted.
Use comma-separated fields like modifiedTime desc, name
to control ordering based on file properties.
Corpora
Specify the grouping of files the search applies to:
- user: personal files
- drive: files in a specific Shared Drive
- domain: files shared across the domain
- allDrives: a combination of My Drive and all Shared Drives
Spaces
Select where the search should occur:
- drive: regular files and folders
- appDataFolder: application-specific data stored in Drive
Drive ID
Provide the ID of the shared drive you want to search (only needed if you selected drive
in Corpora).
Include Labels
Add a comma-separated list of label IDs to fetch additional metadata for files that have those labels applied.
Max Results
Set the maximum number of items to return (must be between 1 and 20,000).
Controls how many files/folders are retrieved per request.
Page Token
If continuing a previous search, enter the Page Token to fetch the next set of results.
If left empty, the first page will be retrieved.
Important Note:
To maximize the flexibility and power of your searches, you can use advanced query terms and operators when filling the Query field.
🔎 For a full list of available search query terms and operators, please visit Google Drive API Search Terms Guide.
📚 To see real-world examples of how to build effective search queries, check out Google Drive API Search Examples.
Taking advantage of these options allows you to perform more precise and tailored searches across your users' Google Drive content.
📤 Outputs
Result Count
Indicates the number of files or folders retrieved in the current search result. If the Next Page Token is present, it means there are additional items available beyond the current list.
Files/Folders
Details of each file or folder retrieved are provided with the following information:
-
Id
The unique identifier of the file or folder. -
Drive Id
If the file or folder is located in a shared drive, this field shows the ID of that shared drive. -
Description
A brief description of the file, if one has been provided. -
Name
The name of the file or folder as it appears in Google Drive. -
Mime Type
The MIME type of the file, specifying the file format (e.g., application/pdf, application/vnd.google-apps.folder). -
Version
The version number of the file, useful for tracking changes or updates. -
View Link
A direct link for opening the file in a relevant Google editor or viewer via a browser. -
Original Filename
The original name of the uploaded content if available, otherwise it matches the current file name. This is mainly shown for files with binary content. -
File Extension
The extension of the file extracted from its name (e.g., "pdf", "docx", "tar.gz"). -
Download Link
A direct link to download the file's content from Google Drive. -
Size
The file size in bytes. -
Trashed
Indicates whether the file or folder has been moved to the Trash, either directly or because its parent folder was trashed. -
Modified Time
The last time the file was edited by any user. -
Created Time
The time when the file was originally created. -
Owners
Information about the owner(s) of the file:- Display Name: The full name of the owner.
- Email Address: The email address of the owner.
-
Permissions
A full list of permissions granted on the file or folder, including:- Id: The ID of the specific permission setting.
- Display Name: Name associated with the permission (e.g., user or group name).
- Type: The type of entity (user, group, domain, anyone) the permission applies to.
- Email Address: Email linked to the permission (for users/groups).
- Role: The access level assigned (owner, writer, reader, etc.).
- Domain: The domain associated with the permission.
- Deleted: Whether the associated account has been deleted.
- Pending Owner: Whether the account is pending ownership acceptance.
- Allow File Discovery: Whether the file can be discovered via search (mainly for domain or public sharing).
-
Parents
The IDs of parent folders that contain the file. -
Shared
Indicates whether the file has been shared with others (this field may not be populated for items stored in shared drives).
Next Page Token
A token to retrieve the next batch of results if there are more files or folders available beyond the current list. If absent, all available results have been retrieved.
💡Example
Imagine your organization needs to audit all documents created by a specific employee to ensure they comply with company policies.
You can set up the "List User's Files/Folders" action by:
- Selecting the Google Workspace connection with the appropriate service account.
- Entering the user's primary email.
- Setting a File Name filter if you're looking for documents containing specific words (e.g., "Policy", "Agreement").
- Choosing Search For to list Files, Folders, or Both.
- Setting Exclude Trashed Items to "Yes" to avoid listing deleted files.
- Optionally configuring Order By to sort the results by modifiedTime to quickly find the latest documents.
Once set up, when you run the flow, it will retrieve and list all active files or folders owned or accessible by the specified user based on your criteria.
You can then review, manage, or trigger further actions based on the listed results.
Updated 3 days ago