Skip to content

On a schedule

List Google Drive folder files in Google Sheets

A sheet tab keeps an index of every file in a Drive folder and its subfolders, with folder path, type, owner, last modified and link.

Runs
On a schedule
Apps
Google Drive, Google Sheets
AI
Not needed
Access
Google Drive read; Google Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: every night at 1am, list every file in my Client Deliverables Drive folder, including subfolders, in the Index tab of my sheet with its folder path, file type, owner, last modified date and link.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Drive search is good for finding one file, not for seeing everything in a project at once. When a client asks what was delivered, or an audit needs a list of documents, someone ends up clicking through folders and copying names.

This automation keeps an index of a Drive folder and all its subfolders in a sheet tab, rebuilt nightly with the folder path, owner, file type, last modified date and link of every file.

Agencies, legal and compliance teams, and anyone handing over a project use it as a living table of contents.

What you get out of it

  • Every file in one table

    Nested subfolders are flattened into a single list with the folder path kept as a column.

  • Spot stale or missing documents

    Sort by modified date to see what has not been touched, or filter by folder to find gaps.

  • Owners are visible

    The owner column shows who to ask about a file, and highlights files owned by people who have left.

  • Shareable without Drive access

    Send the index to someone who only needs to know what exists.

  • Rebuilt nightly

    Deleted files drop off and new ones appear without upkeep.

How it works

What happens, step by step

  1. Every night ClickRuntime walks through the Drive folder you choose and all of its subfolders.

  2. For each file it notes the folder path, name, type, owner, last modified date and link.

  3. The Index tab is cleared and rewritten, newest changes first.

Before it runs live

  • Connect Google Drive
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsOn a schedule
List Google Drive folder files in Google Sheetstoday, 9:00Succeeded
Google Sheets · Deliverables › IndexAcme / 2026 / November | Acme brand guidelines v3.pdf | PDF | maria@studio.co | 2026-11-09 | drive.google.com/file/d/1aB…

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Drive and Google Sheets steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
list_google_drive_folder_files_in_google_sheets.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, report_fetched

ROOT_FOLDER = "your-folder-id"
SHEET_ID = "your-spreadsheet-id"
FOLDER = "application/vnd.google-apps.folder"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    drive = build("drive", "v3", credentials=creds, cache_discovery=False).files()
    rows, queue = [], [(ROOT_FOLDER, "")]
    while queue:
        folder_id, path = queue.pop()
        token = None
        while True:
            res = drive.list(q=f"'{folder_id}' in parents and trashed = false", pageSize=1000, pageToken=token,
                             fields="nextPageToken, files(id,name,mimeType,modifiedTime,owners(emailAddress),webViewLink)").execute()
            for f in res["files"]:
                if f["mimeType"] == FOLDER:
                    queue.append((f["id"], f"{path} / {f['name']}".strip(" /")))
                else:
                    kind = f["mimeType"].split("/")[-1].replace("vnd.google-apps.", "Google ").upper() if "/" in f["mimeType"] else f["mimeType"]
                    rows.append([path or "(top)", f["name"], kind, (f.get("owners") or [{}])[0].get("emailAddress", ""),
                                 f["modifiedTime"][:10], f["webViewLink"]])
            token = res.get("nextPageToken")
            if not token:
                break
    report_fetched(len(rows))
    rows.sort(key=lambda r: r[4], reverse=True)
    tab = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values()
    tab.clear(spreadsheetId=SHEET_ID, range="Index!A:F").execute()
    tab.update(spreadsheetId=SHEET_ID, range="Index!A1", valueInputOption="RAW",
               body={"values": [["Folder", "File", "Type", "Owner", "Modified", "Link"]] + rows}).execute()
    return {"files": len(rows)}

FAQ

Common questions

Does it work for shared drives?
Yes, with one change: ask your assistant to add supportsAllDrives and includeItemsFromAllDrives to the Drive call, and use the shared drive folder ID.
How large a folder can it handle?
Thousands of files are fine; the script pages through results. For very large trees, ask for the run to only list files changed in the last month.
Can it flag files shared publicly?
Yes. Drive can return each file's sharing settings, so a Shared with column or an anyone-with-link flag can be added.
What permissions does it need?
Google Drive read; Google Sheets read+write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “List Google Drive folder files in Google Sheets” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.