Writes every message your Telegram bot receives to a Google Sheet as a row - the time, who sent it and exactly what they typed.

UsesGoogle SheetsTelegram

Log Telegram messages to a spreadsheet

Whenever your Telegram bot receives a message, one new row is added to your Google Sheet holding exactly what was typed. Nothing is summarized, categorized or rewritten on the way, so the sheet stays a plain record you can read, filter and total yourself.

Each row records when the message arrived, the sender's Telegram username, their numeric user ID and the text itself, in that order. Rows are only ever added, so nothing already on the tab is touched. A message with no text, such as a photo or a sticker, is skipped rather than written as a blank row, and a sender with no username is recorded as 'unknown' with their numeric ID still beside it, so no message is lost. This is the answering half of a check-in loop: if you also want a question sent to you on a schedule, that is a second workflow posting to the same chat.

Before the first run you need a Telegram bot in the chat you want recorded and a sheet with a tab carrying those four column headings.

TelegramTelegramWhen a new message is received. Save it as incomingMessage.When a new message is received. Save it as incomingMessage.
Set spreadsheetUrl to blank.Set spreadsheetUrl to blank.
Set sheetName to blank.Set sheetName to blank.
Set messageText to blank.Set messageText to blank.
If a step below fails, save the error as noTextErrorIf a step below fails, save the error as noTextError
Try
Trim incomingMessage.text and save it as messageText.Trim incomingMessage.text and save it as messageText.
On error
No steps
If messageText is emptyIf messageText is empty
Yes
Finish the run: That message carried no text, so there was nothing to record.Finish the run: That message carried no text, so there was nothing to record.
No
No steps
Set senderName to blank.Set senderName to blank.
If a step below fails, save the error as noSenderErrorIf a step below fails, save the error as noSenderError
Try
Trim incomingMessage.from_username and save it as senderName.Trim incomingMessage.from_username and save it as senderName.
On error
No steps
If senderName is emptyIf senderName is empty
Yes
Change senderName to “unknown”.Change senderName to “unknown”.
No
No steps
Set senderId to “@incomingMessage.from_user_id”.Set senderId to “@incomingMessage.from_user_id”.
If senderId is “null”If senderId is “null”
Yes
Change senderId to blank.Change senderId to blank.
No
No steps
Get the current date and time and save it as recordedAt.Get the current date and time and save it as recordedAt.
Google SheetsGoogle SheetsAdd a row to sheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.