Weekly
Publish a weekly analysis of your sheet data in Notion
Every Monday last week's rows in your sheet are analysed and a report page with findings and likely causes is published in Notion.
- Runs
- Weekly
- Apps
- Google Sheets, Notion
- AI
- Yes, uses the built-in AI allowance
- Access
- Sheet read; Notion insert
Send this to your assistant
Create a ClickRuntime automation: every Monday, analyse last week's rows in my Invoice exceptions sheet and publish a report with the main causes in Notion, then email me the link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A finance lead at a wholesale business logs every invoice exception in a sheet: wrong prices, missing purchase orders, duplicate bills. The log grows every week, but nobody has time to step back and ask which suppliers or causes keep coming up. The same problems repeat because the pattern is never written down.
This automation takes last week's rows each Monday, works out the totals by supplier and type, and has AI write a short report on what stands out and the likely causes. The report is published as a Notion page where the team already keeps its notes, and you get an email with the link.
What you get out of it
Patterns become visible
Totals by supplier and cause show where the repeat problems are. One clear finding can be worth more than a hundred individual fixes.
A report nobody has to write
The weekly analysis appears without anyone setting aside time for it. The team reads and discusses instead of compiling.
A history of every week
Each report is its own Notion page, so you can compare this month with last and see whether a fix worked.
Works for other kinds of logs
Spend, feedback or contract checks follow the same pattern. Any sheet with one row per item and a date can feed a weekly report.
How it works
What happens, step by step
Every Monday, ClickRuntime reads the rows from the past week in your sheet.
It counts the rows and adds up the amounts by supplier and by type.
AI writes a short report on what stands out and the likely causes.
The report is published as a new page in Notion, and you get an email with the link.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Notion and share the database you want it to 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
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and Notion steps into one automation
Under the hood
The code that runs this automation
from collections import Counter
from datetime import date, timedelta
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, notify
SHEET_ID, REPORTS_DB = "your-spreadsheet-id", "your-notion-database-id"
@on_trigger
def run(event):
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
rows = sheets.values().get(spreadsheetId=SHEET_ID, range="Exceptions!A2:E").execute().get("values", [])
since = (date.today() - timedelta(days=7)).isoformat()
week = [r for r in rows if len(r) >= 3 and r[0] >= since]
if not week:
return {"rows": 0}
stats = f"{len(week)} exceptions. By supplier: {Counter(r[1] for r in week).most_common(5)}. By type: {Counter(r[2] for r in week).most_common(5)}."
sample = "\n".join(" | ".join(r) for r in week[:80])
try:
report = ai.generate(f"{stats}\n\nRows:\n{sample}", system="Write a short root-cause report: key findings, likely causes, suggested fixes.", max_output_tokens=1000).text
except ai.AIError:
report = stats
paras = [{"object": "block", "type": "paragraph", "paragraph": {"rich_text": [{"text": {"content": p[:1900]}}]}} for p in report.split("\n\n") if p.strip()]
page = http.post("https://api.notion.com/v1/pages", headers={"Authorization": f"Bearer {credentials.connection('notion', 'work')}", "Notion-Version": "2022-06-28"}, json={
"parent": {"database_id": REPORTS_DB}, "properties": {"Name": {"title": [{"text": {"content": f"Exceptions report, week from {since}"}}]}},
"children": paras}).json()
notify.email_me("Weekly exceptions report published", f"{stats}\n\n{page['url']}")
return {"rows": len(week)}FAQ
Common questions
What does the sheet need?
Are the numbers calculated by AI?
Who can see the report in Notion?
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
Log news from your feeds to a sheet with a daily Notion report
Each day, new items from your RSS feeds are categorised and summarised by AI, added to a sheet and collected into a report page in Notion.
See how it worksTurn this week's saved links into a newsletter draft in Notion
Every Friday, the links you collected in your sheet become a newsletter draft page in Notion, ready to edit.
See how it worksCopy yesterday's metrics from a sheet into a Notion daily report
Each morning, yesterday's campaign totals are added up from your metrics sheet and saved as an entry in your Notion daily-report database.
See how it worksKeep exploring
Set up “Publish a weekly analysis of your sheet data in Notion” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.