Writes every message your Telegram bot receives to a Google Sheet as a row - the time, who sent it and exactly what they typed.
Uses
Google Sheets
Telegram
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 summarised, categorised 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.
incomingMessage.When a new message is received. Save it as incomingMessage.spreadsheetUrl to blank.Set spreadsheetUrl to blank.sheetName to blank.Set sheetName to blank.messageText to blank.Set messageText to blank.noTextErrorIf a step below fails, save the error as noTextErrorincomingMessage.text and save it as messageText.Trim incomingMessage.text and save it as messageText.messageText is emptyIf messageText is emptysenderName to blank.Set senderName to blank.noSenderErrorIf a step below fails, save the error as noSenderErrorincomingMessage.from_username and save it as senderName.Trim incomingMessage.from_username and save it as senderName.senderName is emptyIf senderName is emptysenderName to unknown.Change senderName to unknown.senderId to incomingMessage.from_user_id.Set senderId to incomingMessage.from_user_id.senderId is nullIf senderId is nullsenderId to blank.Change senderId to blank.recordedAt.Get the current date and time and save it as recordedAt.sheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.