Skip to content

Every 30 minutes

Turn emailed PDF timesheets into rows in Excel

PDF timesheets emailed in by contractors are read and their hours added to your Excel timesheet table, and you are told about any that can't be read.

Runs
Every 30 minutes
Apps
Microsoft Excel, Outlook
AI
Yes, uses the built-in AI allowance
Access
Mail.Read, Files.ReadWrite

Send this to your assistant

Create a ClickRuntime automation: every 30 minutes, find new emails in Outlook with 'timesheet' in the subject and a PDF attached. Use AI to read the person's name, week and hours per project, add a row per project to my Timesheets table in Excel, and email me if a timesheet can't be read.

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

A small agency works with a dozen freelancers who send weekly timesheets as PDFs. The office manager types every line into Excel before invoicing clients. It takes a morning each week and errors flow straight into client invoices.

Reading each timesheet as it arrives and adding the hours to Excel cuts the retyping, and the email for unreadable ones makes sure nothing is missed.

What you get out of it

  • No retyping hours

    Hours per project go straight into the timesheet table.

  • Fewer billing mistakes

    Numbers are copied exactly as written, without typing errors.

  • Nothing missed

    Timesheets that can't be read are flagged to you, rather than silently skipped.

  • Ready for invoicing

    The table can feed your client billing as soon as the week's timesheets are in.

How it works

What happens, step by step

  1. Every 30 minutes, ClickRuntime looks in Outlook for new emails with timesheet in the subject and a PDF attached.

  2. AI reads each PDF and pulls out the person's name, the week and the hours per project.

  3. One row per project is added to your Timesheets table in Excel.

  4. If a timesheet can't be read, you get an email with the sender and subject so you can check it.

Before it runs live

  • Connect Microsoft Excel
  • Connect Outlook

What you get

RunsEvery 30 minutes
Turn emailed PDF timesheets into rows in Exceltoday, 9:00Succeeded
Excel · TimesheetsJamie Lee | 2026-10-12 | Acme website rebuild | 22.5

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

  • Act only on the items that match your own rules, and skip the rest
  • 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 Microsoft Excel and Outlook 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.
timesheets_from_email_into_excel.pyexample
import base64
import io
from pypdf import PdfReader
from clickruntime import on_trigger, report_fetched, http, credentials, ai, state, notify

def graph(method, path, **kw):
    r = http.request(method, "https://graph.microsoft.com/v1.0" + path, headers={"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}, **kw)
    return r.raise_for_status() or (r.json() if r.content else None)

pdf_text = lambda b64: " ".join(p.extract_text() or "" for p in PdfReader(io.BytesIO(base64.b64decode(b64))).pages)[:12000]

BOOK = "/me/drive/items/your-workbook-id/workbook"
SCHEMA = {"type": "object", "properties": {"ok": {"type": "boolean"}, "name": {"type": "string"}, "week": {"type": "string"},
          "lines": {"type": "array", "items": {"type": "object", "properties": {"project": {"type": "string"}, "hours": {"type": "number"}}}}}}

@on_trigger
def run(event):
    since = state.get("since") or "2026-01-01T00:00:00Z"
    msgs = graph("GET", "/me/messages", params={"$filter": f"hasAttachments eq true and receivedDateTime gt {since}", "$orderby": "receivedDateTime", "$top": 25})["value"]
    msgs = [m for m in msgs if "timesheet" in m["subject"].lower()]
    report_fetched(len(msgs))
    if not msgs:
        return {"summary": "No new timesheets"}
    for m in msgs:
        for a in graph("GET", f"/me/messages/{m['id']}/attachments")["value"]:
            if a.get("contentType") == "application/pdf":
                ts = ai.generate(pdf_text(a["contentBytes"]), system="Read this timesheet: person's name, week starting (YYYY-MM-DD), hours per project. "
                                 "Set ok=false if unreadable.", json_schema=SCHEMA, max_output_tokens=300).json
                if ts["ok"] and ts["lines"]:
                    graph("POST", f"{BOOK}/tables/Timesheets/rows/add", json={"values": [[ts["name"], ts["week"], l["project"], l["hours"]] for l in ts["lines"]]})
                else:
                    notify.email_me("Timesheet needs checking", f"{m['from']['emailAddress']['address']}: {m['subject']}")
    state.set("since", max(m["receivedDateTime"] for m in msgs))
    return {"timesheets": len(msgs)}

FAQ

Common questions

What format must timesheets be in?
Any PDF with the person's name, the week and hours by project. Different layouts from different freelancers are fine.
Can it handle Excel or Word timesheets?
This version reads PDFs. Other formats can be added if your freelancers use them.
Does it reply to the freelancer?
Not by default. It can send a short confirmation if you want.
What permissions does it need?
Mail.Read, Files.ReadWrite. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new 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 “Turn emailed PDF timesheets into rows in Excel” from your assistant

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