Fix Power Query Not Listing Files in Google Drive Subfolders
Question details
The user needs to list and monitor files from a main Google Drive folder and its subfolders using Power Query, but the query is currently returning no files for the subfolders.
- Product
- Power Query
- Device & OS
- not provided
- Scenario
- Attempting to scrape or extract file lists from Google Drive subfolders using M code to combine them into a single monitoring query.
- Observed behavior
- Power Query successfully connects and lists files from the main Google Drive folder, but queries for subfolders connect without returning any file objects.
Verify that you have direct access links to the specific Google Drive subfolders and ensure the sharing permissions are set to allow access without authentication barriers.
Review and Adjust the M Code for Subfolder Queries
Check the specific M code used for the subfolders to ensure the extraction logic correctly handles the subfolder's web structure.
When using Web.BrowserContents and Html.Table to scrape Google Drive, the HTML structure of a subfolder view might differ slightly from the main folder, causing the extraction to return an empty table.
In Power Query, select the failing subfolder query, go to the Home tab, and click 'Advanced Editor' to view the M code.
Check the URL inside the Web.BrowserContents function to ensure it points directly to the unique ID of the Google Drive subfolder (e.g., Classes-Done or Classes-UpNext).
Review the Html.Table function parameters. Ensure the CSS selectors used to identify file rows are still valid for the subfolder's web page structure.
Create a Single Recursive Query
Combine the main folder and subfolders into a single query by recursively expanding folder contents.
Try WPS Office for Seamless Data Management
If complex Power Query setups and web scraping in Microsoft Excel are complicating your workflow, consider WPS Office. It provides a lightweight, highly compatible, and free alternative for managing spreadsheets, analyzing data, and collaborating efficiently.
- 1. Download and Install: Visit the official WPS Office website to download the free suite and follow the simple installation instructions.
- 2. Open Your Spreadsheets: Launch WPS Spreadsheets and easily open your existing Excel workbooks and data sets directly.
- 3. Analyze Data: Use the intuitive Data tab tools to sort, filter, and organize your files without the need for complex web scraping queries.

Frequently Asked Questions
Why does Power Query return an empty table for Google Drive subfolders?
This usually happens when using web scraping functions like Web.BrowserContents. The HTML structure of the subfolder page may differ from the main folder, causing the Html.Table function to miss the file elements.
Can Power Query recursively search subfolders in Google Drive?
Yes, if you use a connector or API that returns folder structures (like the Google Drive API). You can expand the folder metadata columns in Power Query to list all contents recursively in a single query.
Is Web.BrowserContents the best way to get files from Google Drive in Power Query?
Not always. Scraping Google Drive with Web.BrowserContents can be unreliable due to changes in web page structures and authentication barriers. Using the Google Drive API with a Web connector is generally a more stable approach.




