Skip to content

Every 5 minutes

Add rows to an Excel table from Telegram messages

Messages sent to your Telegram bot in a set format, such as "12.50 lunch with client", are added as dated rows to an Excel table in OneDrive, and the bot replies to confirm.

Runs
Every 5 minutes
Apps
Microsoft Excel, Telegram
AI
Not needed
Access
Telegram bot token; Microsoft Files.ReadWrite

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, read new messages sent to my Telegram bot, turn each one like '12.50 taxi to airport' into a row with date, amount and note in the Log table of log.xlsx on OneDrive, and reply in Telegram 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

Keeping a log in Excel is easy at a desk and awkward on a phone. Opening a workbook on mobile to add one line is slow enough that people stop doing it.

This lets you send a quick message to your own Telegram bot and has the line appear in an Excel table on OneDrive. The bot replies so you know it landed.

It suits expense tracking, mileage logs, hours worked, stock counts or any running list you keep in Excel and want to add to while out.

What you get out of it

  • Add a row in seconds

    Typing '12.50 parking' in a chat is faster than opening Excel on a phone. Entries get logged when they happen, not reconstructed later.

  • A real Excel table

    Rows go into a proper table, so totals, filters and PivotTables in the workbook keep working as the list grows.

  • Confirmation every time

    The bot's reply shows exactly what was saved. A typo is easy to spot and fix straight away.

  • Only your chat counts

    Messages from other people who find the bot are ignored, so nobody else can write to your file.

  • Dates added for you

    Each row is stamped with today's date, so you only type the amount and the note.

How it works

What happens, step by step

  1. Every 5 minutes ClickRuntime checks your Telegram bot for new messages.

  2. Only messages from your chat are used; others are ignored.

  3. Each message is split into an amount and a note, and a row with today's date is added to your Excel table.

  4. The bot replies with what was saved, or explains the format if the message could not be read.

Before it runs live

  • Connect Microsoft Excel
  • Connect Telegram

What you get

RunsEvery 5 minutes
Add rows to an Excel table from Telegram messagestoday, 9:00Succeeded
Telegram · your botYou: 12.50 taxi to airport Bot: ✅ Added to Log: 2026-11-10 · 12.50 · taxi to airport

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
  • 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 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.
add_rows_to_an_excel_table_from_telegram_messages.pyexample
import re
from datetime import date
from clickruntime import on_trigger, credentials, http, state

GRAPH = "https://graph.microsoft.com/v1.0"
TG = "https://api.telegram.org"
TABLE = "/me/drive/root:/Finance/log.xlsx:/workbook/tables/Log/rows"
MY_CHAT = 123456789

def tg(method, **body):
    return http.post(f"{TG}/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=body).json()

@on_trigger
def run(event):
    offset = state.get("offset") or 0
    updates = tg("getUpdates", offset=offset, timeout=0).get("result", [])
    h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
    added = 0
    for u in updates:
        offset = u["update_id"] + 1
        msg = u.get("message") or {}
        if msg.get("chat", {}).get("id") != MY_CHAT or "text" not in msg:
            continue
        m = re.match(r"^\s*(\d+(?:[.,]\d{1,2})?)\s+(.+)$", msg["text"])
        if not m:
            tg("sendMessage", chat_id=MY_CHAT, text="Send an amount then a note, e.g. 12.50 taxi to airport")
            continue
        amount, note = float(m.group(1).replace(",", ".")), m.group(2).strip()
        http.post(f"{GRAPH}{TABLE}", headers=h, json={"values": [[date.today().isoformat(), amount, note]]}).raise_for_status()
        tg("sendMessage", chat_id=MY_CHAT, text=f"✅ Added to Log: {date.today()} · {amount:.2f} · {note}")
        added += 1
    state.set("offset", offset)
    return {"added": added}

FAQ

Common questions

Does the Excel file need a table?
Yes. Select the header row and data in Excel and use Format as Table, then name it Log (or change the name in the script). New rows are added to the end of the table with the columns Date, Amount and Note.
Can my partner log entries too?
Yes. Add their Telegram chat ID to the allowed list, or add the bot to a small group and use the group's chat ID. Messages from anyone else are ignored.
Can it understand free-form messages like 'spent 20 on fuel'?
This version uses a fixed amount-then-note format so it never guesses. Your assistant can add AI to pull the amount and category out of free text on a paid plan.
What permissions does it need?
Telegram bot token; Microsoft Files.ReadWrite. 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 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 “Add rows to an Excel table from Telegram messages” from your assistant

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