Daily
Back up a sheet tab every night
Each night a dated copy of your tab is kept, with the last 14 days saved.
- Runs
- Daily
- Apps
- Google Sheets
- AI
- Not needed
- Access
- read+write
Send this to your assistant
Create a ClickRuntime automation: every night, copy my Orders tab to a new tab named with today's date, keep the last 14 copies and email me if it fails.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Spreadsheets get edited by many hands, and the damage is rarely noticed on the day it happens. Someone sorts only one column, an import script overwrites last month's figures, a formula range is dragged over a block of hand-typed numbers. By the time a finance lead spots that the totals look wrong, version history is a long scroll of unnamed edits and nobody can say which one was the bad one.
Each night a copy of the tab is created inside the same spreadsheet and renamed with that day's date, so you end up with a row of tabs like 2026-10-18 and 2026-10-19. Backup tabs older than 14 days are deleted to keep the file from ballooning, and if any step fails an email tells you the same morning.
It is most useful for budgets, inventory counts and customer lists that are edited constantly but only audited occasionally.
What you get out of it
A clean restore point every day
If a bad paste ruins this week's data, you copy the values back from last night's tab in a minute. You are not reconstructing the sheet from scattered revision history.
Mistakes are found by comparing days
With dated tabs side by side, you can see exactly when a total changed. That turns an argument about who broke it into a quick lookup with a date attached.
The file stays a manageable size
Dropping copies older than 14 days stops the workbook from growing by a tab every night forever. Sheets slow down badly with hundreds of tabs, and this avoids that problem.
Silence means the backup worked
You only hear about it when something fails. A broken backup you find out about months later is worse than none, so the failure email matters more than a success message would. A quiet morning inbox is the sign that the copy exists.
A lightweight audit trail for reviewers
Month-end reviewers or auditors can open the tab dated the close day and see what the numbers were then, not what they have become after later edits. That is a plain, dated answer to a reviewer's question.
How it works
What happens, step by step
Every night ClickRuntime makes a copy of your Orders tab inside the same Google Sheet.
The copy is named with today's date.
Backup tabs beyond the latest 14 are deleted, so the sheet doesn't grow forever.
If the backup fails, you get an email with the reason.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
What you get
Build your own
Need it to work differently?
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 Sheets steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import date
from clickruntime import on_trigger, credentials, notify
SHEET_ID = "your-spreadsheet-id"
KEEP = 14
@on_trigger
def run(event):
try:
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
tabs = sheets.get(spreadsheetId=SHEET_ID, fields="sheets.properties").execute()["sheets"]
orders = next(t["properties"]["sheetId"] for t in tabs if t["properties"]["title"] == "Orders")
requests = [{"duplicateSheet": {"sourceSheetId": orders, "newSheetName": f"Orders {date.today()}", "insertSheetIndex": len(tabs)}}]
backups = sorted((t["properties"] for t in tabs if t["properties"]["title"].startswith("Orders 20")),
key=lambda p: p["title"])
requests += [{"deleteSheet": {"sheetId": p["sheetId"]}} for p in backups[:max(0, len(backups) + 1 - KEEP)]]
sheets.batchUpdate(spreadsheetId=SHEET_ID, body={"requests": requests}).execute()
except Exception as e:
notify.email_me("Orders backup failed", f"{type(e).__name__}: {e}")
raise
return {"copied": f"Orders {date.today()}", "removed": len(requests) - 1}FAQ
Common questions
Where do the backup tabs go?
Does it back up formulas or only values?
Can I keep more than 14 days of backups?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Keep your sheet free of duplicates and bad data
Duplicate rows are removed, names and phone numbers are tidied, and invalid emails are flagged.
See how it worksMonitor your sites and SSL certificates
You're warned when a site in your list is down or its certificate expires within 14 days.
See how it worksGet alerts for upcoming dates in a sheet
You're emailed when a date in your sheet is coming up or a value crosses a limit.
See how it worksKeep exploring
Set up “Back up a sheet tab every night” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.