Google Drive Search File/Folder Returns Folder Id, not Contents

Goal

Trying to use the Google Drive node to get the list of files / sub-folders in a specified folder.

Workflow Setup

Based on this I set up the Google Drive node with:

  • Resource: File/Folder ,
  • Operation: Search ,
  • Search Method: Search File/Folder Name
  • Search Query: saved_docs
    • The hint on the search query field is e.g. My File / My Folder

Expected Behavior

I was expecting the output to have the list of files in the saved_docs folder, but I only get the name/id object for the folder itself. Like this:

[
  {
    "id": "130LJPSOmIBU7wwwc7HtcT5DwsHp7UUiw",
    "name": "saved_docs"
  }
]

Other (wrong) Guesses

  • Also tried Search Query: 'saved_docs' in parents according to this but that just got an error.
  • Also tried Search Query: saved_docs/* but that gives the same result as saved_docs (without the wildcard).
  • Also tried Search Query: /saved_docs but that results in “No output data returned”

Is there some kind of wildcard or query syntax required to get the list of files in a specified folder?

Information on your n8n setup

  • n8n version: 1.50.0
  • Database (default: SQLite): Postgres 16
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Docker Host == Raspberry Pi OS

Hey @hubschrauber , I think there should be the following met

  1. The files need to be either owned or shared with the user that connects to Google Drive for you (sharing the folder itself should do the trick)
  2. Set the search Query to * and add the filter “Folder”. That is where you would limit the returned items to the content of the folder, and not the folder itself

2 Likes

That worked. Might have eventually poked around at enough stuff to find this but sometimes the stuff that’s hiding by default is elusive. Can’t say I’m a fan of having to open all the doors, hatches, and drawers to find that one particular wrench or screwdriver I need. Guess it’s a balance between up-front clutter and feature-findability. Thanks for telling me it was in the second cabinet from the left, behind the jar of spare bolts :wink:

1 Like