Skip to content

The moment it happens

Log receipts sent to Telegram in Excel

Send a photo or PDF of a receipt to your Telegram bot and the date, supplier and amount are added to your Excel expenses table.

Runs
The moment it happens
Apps
Microsoft Excel, Telegram
AI
Yes, uses the built-in AI allowance
Access
Files.ReadWrite; bot token

Send this to your assistant

Create a ClickRuntime automation: when I send a receipt photo or PDF to my Telegram bot, read the date, supplier and total, add it to the Expenses table in my Excel workbook on OneDrive, and reply to confirm.

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

Receipts get stuffed in wallets and glove boxes, and expense claims are pieced together at the end of the month from faded paper. Tradespeople and consultants lose money on costs they can't evidence.

Snapping a receipt into a Telegram chat the moment you pay, and having it read and logged in Excel, means every cost is recorded on the day, with no typing and no shoebox at month end.

What you get out of it

  • Logged the moment you pay

    Take a photo at the till and you're done. The receipt can't get lost before it's recorded.

  • No typing

    Date, supplier and total are read from the photo. You only correct the occasional misread.

  • Duplicates caught

    Sending the same receipt twice is spotted and skipped. Your totals stay right.

  • Ready for your accountant

    Everything is in one Excel table. Filter by month and send it on.

How it works

What happens, step by step

  1. You send a receipt photo or PDF to your Telegram bot.

  2. It checks the message came from an allowed person and downloads the file.

  3. AI reads the date, supplier and total from the receipt.

  4. If the same receipt was already logged it's skipped; otherwise a row is added to your Excel table.

  5. The bot replies with what it recorded.

Before it runs live

  • Connect Microsoft Excel
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Log receipts sent to Telegram in Exceljust nowSucceeded
Telegram · Receipts botLogged Northwind Hardware 84.20 on 2026-10-18

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 Telegram 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.
snap_a_receipt_or_invoice_in_telegram_log_it_to_excel.pyexample
GRAPH = "https://graph.microsoft.com/v1.0"
TG = "https://api.telegram.org"
import base64
from clickruntime import on_event, credentials, http, state, ai

ALLOWED = {123456789}
TABLE = "/me/drive/root:/Finance/expenses.xlsx:/workbook/tables/Expenses/rows/add"
SCHEMA = {"type": "object", "properties": {"date": {"type": "string"}, "supplier": {"type": "string"}, "total": {"type": "number"}}, "required": ["date", "supplier", "total"]}

@on_event
def handle(event):
    msg = (event.json or {}).get("message", {})
    chat = msg.get("chat", {}).get("id")
    f = (msg.get("photo") or [None])[-1] or msg.get("document")
    if chat not in ALLOWED or not f:
        return {"skipped": True}
    bot = f"{TG}/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}"
    path = http.get(f"{bot}/getFile", params={"file_id": f["file_id"]}).json()["result"]["file_path"]
    data = http.get(f"{TG}/file/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{path}").content
    r = ai.generate(["Read this receipt. Return date (YYYY-MM-DD), supplier and total.", base64.b64encode(data).decode()[:30000]],
                    json_schema=SCHEMA, max_output_tokens=80).json
    key = f"{r['date']}|{r['supplier'].lower()}|{r['total']}"
    if state.get(key):
        http.post(f"{bot}/sendMessage", json={"chat_id": chat, "text": "Already logged this one."})
        return {"duplicate": key}
    h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
    http.post(f"{GRAPH}{TABLE}", headers=h, json={"values": [[r["date"], r["supplier"], r["total"], str(chat)]]}).raise_for_status()
    state.set(key, True)
    http.post(f"{bot}/sendMessage", json={"chat_id": chat, "text": f"Logged {r['supplier']} {r['total']:.2f} on {r['date']}"})
    return {"logged": key}

FAQ

Common questions

Does it work with PDFs as well as photos?
Yes. Photos of paper receipts and PDF invoices both work.
What if it reads the amount wrong?
The bot's reply shows what it recorded, so you can spot a mistake and fix the row in Excel.
Can colleagues send receipts too?
Yes. List their Telegram chat IDs and each row records who sent it.
What permissions does it need?
Files.ReadWrite; bot token. 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 for each event the app sends.
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 “Log receipts sent to Telegram in Excel” from your assistant

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