Actions17
File/Folder → Search
AI-generatedSummary
Searches Google Drive for files and folders by name or by a Google Drive query string, with optional filtering by drive, folder, item type, MIME type, and trashed state.
Inputs
- Authentication — The authentication method to use: OAuth2 (recommended) or Service Account. Defaults to OAuth2.
- Search Method — Whether to search by file/folder name or use a raw Google Drive query string. Defaults to 'name'.
- Search Query — The name of the file or folder to search for when Search Method is 'name'. Returns partial matches. Optional; defaults to empty string.
- Query String — The Google Drive query string to use when Search Method is 'query'. Uses Google Drive query syntax, e.g.
not name contains 'hello'. Optional; defaults to empty string. - Return All — Whether to return all results or only up to a given limit. Defaults to false.
- Limit — Maximum number of results to return when Return All is false. Defaults to 50, minimum 1.
- Drive — The drive to search in. Defaults to 'My Drive'. Optional.
- Folder — The folder to search in. Defaults to the root folder. If a non-root folder is selected, only direct children are included. Optional.
- What to Search — What to search: files and folders, only files, or only folders. Defaults to 'all'.
- File Types — MIME types to restrict results to when searching files or files-and-folders. Defaults to empty (no MIME type filter). Optional.
- Include Trashed Items — Whether to include trashed items. Defaults to false.
- Fields — The fields to return for each result. Defaults to empty (no explicit field selection). Optional.
Output shape
An array of Drive resource objects containing metadata such as id, name, mimeType, webViewLink, etc., depending on the selected Fields.
The operation returns an array of Google Drive file/folder objects matching the search criteria. The returned metadata fields are controlled by the Fields option. When Fields is empty, the response uses the default field set from the Google Drive API.
Examples
Example 1: A workflow author needs to find a file by a partial name in their Drive. They select the File/Folder resource, Search operation, set Search Method to 'Search File/Folder Name', enter a partial file name in Search Query, leave Return All false, and set a Limit. The node returns up to that many matching files/folders.
Search by name
Example 2: A workflow author needs to find all Google Sheets in a specific shared drive that are not trashed. They select Search Method 'Advanced Search', enter the query string, choose the Drive, set What to Search to 'Files', select Google Sheets under File Types, and enable Return All. The node returns all matching sheet files.
Advanced query with filters