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.
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
Every 5 minutes ClickRuntime checks your Telegram bot for new messages.
Only messages from your chat are used; others are ignored.
Each message is split into an amount and a note, and a row with today's date is added to your Excel table.
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
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
- 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
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?
Can my partner log entries too?
Can it understand free-form messages like 'spent 20 on fuel'?
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
Get a Telegram message when an Excel sheet changes
You hear on Telegram whenever rows are added, changed or removed in a shared Excel sheet.
See how it worksGet Telegram reminders for due dates in an Excel sheet
Every morning at 8am a Telegram message lists rows in an Excel sheet that are due today or overdue and not marked Done, with the owner and days late.
See how it worksLog 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.
See how it worksKeep exploring
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.