I have a Google Drive folder called “Cars” with many subfolders. Inside the subfolders I have many .pdf files. Is there a way to list all the subfolders and files using just one Google Drive Node. Actually I have two, the first list all my folders and other look for files in each of them. It works but I wonder if there’s a more efficient way of doing this.
You can achieve this with a single Google Drive node using the “Search” option. Set the node to search for files and folders within the “Cars” folder, and use a query like 'root_folder_id' in parents replace root_folder_id with the actual ID of your “Cars” folder.
This will return a list of all files and subfolders within the “Cars” folder. You can then use the mimeType field to differentiate between folders application/vnd.google-apps.folder and files.
Unfortunately, this method doesn’t allow recursively getting all the file from that a given root folder. If you need to get all file recursively (multiple levels of nesting) you cannot get away with just a single node.
This is what I thought. It’s working well with two nodes, however it seems inefficient. I had a major argument with ChatGPT about that since it was telling me I could do that in one node. Please let me know if someone can figure that out. Thank guys.