Understanding Search Scope in Google Drive: The "Corpora" Setting (When Using List Files/Folders)

When you use the List Files/Folders action in Zenphi to search Google Drive—especially by file name or search query—the "Corpora" setting determines where Zenphi looks. Think of it as defining the search boundaries. Getting this right is crucial when trying to locate files in Shared Drives or across multiple locations.

Here’s how each corpora setting affects the search scope:


🧍‍♂️ Default: Searching "User" Files (corpora='user')

What it does:
If no "Corpora" is specified, Zenphi searches only the authenticated user’s My Drive and files explicitly shared with them (what you typically see under "Shared with me").

Limitations:
This search does not reliably include Shared Drives, even if the user is a member. It may return files the user recently accessed, but it's not dependable for full coverage.

Use when:
You're only searching within My Drive or files directly shared with the user.


📁 Searching a Specific Shared Drive (corpora='drive')

What it does:
Narrows the search to a specific Shared Drive.

How to use in Zenphi:
You'll need to:

  • Provide the Shared Drive ID

  • Set supportsAllDrives=true in the request

Use when:
You know the file or folder is in a particular Shared Drive and want to search by name or use a specific query.


🌐 Searching Across All Drives (corpora='allDrives')

What it does:
Searches everything the user has access to—My Drive and all Shared Drives.

How to use in Zenphi:
Include supportsAllDrives=true to enable this full-scope search.

Use when:
You're unsure of the file’s exact location and want to find it no matter where it’s stored.


🔎 When Using a Search Query or File/Folder Name

If you're trying to locate a file or folder based on a name or query string, choosing the correct "Corpora" becomes even more important. The query will only run within the defined scope, so if your scope excludes the right location (like a Shared Drive), the file won’t be found—even if it exists.


✅ Why This Matters for Zenphi Flows

Say your automation needs to find a file that another tool (like AppSheet) saved to a Shared Drive. If you're relying on the default search, Zenphi might miss it. Configuring List Files/Folders with the appropriate "Corpora" (drive or allDrives) ensures Zenphi searches in the right place—making your flows smarter and more reliable.