Search
Searches for files and folders in Google Drive using a query string.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Drive Id - The identifier for the connected Google Drive service obtained from the Connect node.
- Query - The search query string using Google Drive search syntax.
Output
- files - An array of file objects matching the search query. Each object includes:
- Id - The unique identifier of the file/folder
- Name - The name of the file/folder
- Parents - An array of parent folder IDs
- Kind - The type of the file/folder
- Size - The size of the file in bytes (0 for folders)
- CreatedTime - The time the file/folder was created
- ModifiedTime - The time the file/folder was last modified
How It Works
The Search node finds files and folders in Google Drive that match a specified query. When executed, the node:
- Validates the required inputs (Drive Id and Query)
- Retrieves the Google Drive service client using the provided Drive Id
- Uses the Google Drive API to search files with the Files.List method and Q parameter
- Processes the results into a standardized format
- Returns the array of matching file objects
Requirements
- A valid Google Drive connection established using the Connect node
- A valid search query string using Google Drive search syntax
- Appropriate permissions to search the drive
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Drive Id
- Empty or invalid Query string
- Google Drive API errors during the search operation
- Invalid search query syntax
- Insufficient permissions to search the drive
Usage Notes
- The Query input accepts Google Drive search query syntax, such as:
- "name='filename.txt'" - Find files with a specific name
- "mimeType='application/vnd.google-apps.folder'" - Find folders
- "name contains 'report'" - Find files with "report" in the name
- "'folderId' in parents" - Find files in a specific folder
- "modifiedTime > '2023-01-01T00:00:00'" - Find recently modified files
- Complex queries can combine multiple conditions with "and" or "or"
- The output contains metadata about the files but not their content
- To get file content, use the Download or Export nodes after searching
- The returned file objects can be used in subsequent nodes to process individual files
- Large result sets may take longer to retrieve