- Home
- Integrations
- Telegram
- Telegram + Google Sheets
Telegram and Google Sheets integration: the bot saves messages to a sheet
A Telegram and Google Sheets integration in nana800 takes two blocks: the trigger catches messages to your bot, and the Google Sheets block adds a row for each of them. A row can hold the text, the sender name and username, the chat ID, the date and a link to the file sent. You need a bot token from @BotFather and access to the sheet, with no code and no server.
Build it in the builderWhat you can automate
- Collect leads through a bot: a client writes, and the name, username, text and date land in a new row
- Take reports, receipts and photos from staff: a link to the file sent, up to 20 MB, goes into a sheet column
- Archive posts of a channel where the bot is an admin in a sheet with the date and text
- Count answers to buttons under a bot message: a press starts the scheme too, and the button data goes into the row
- Find a client by username and update their row instead of adding a new one
How to set it up
- 1
Create a bot and prepare the sheet
Send /newbot to @BotFather and copy the bot token. Write column names into the first row of the sheet, for example date, name, username, message. The block puts data under these names and writes them itself into an empty sheet.
- 2
Add the incoming message trigger
Create a scheme in the builder and add the Telegram message from user to bot trigger. Paste the token and choose what starts the scheme: messages only, messages and button presses, or channel posts.
- 3
Give the block access to the sheet
Add the google sheet record block. OAUTH: click the connect button and sign in with a Google account that can open the sheet. SERVICE_ACCOUNT: paste the email and private key of a Google service account and share the sheet with that email as an editor.
- 4
Map columns to message fields
Paste the whole sheet address into the sheet ID field and keep sheet number 0 for the first tab. Choose append_row, and in the row data write a column name on the left and a trigger field on the right: date, name and username from from, text from message, chat_id.
- 5
Turn the scheme on and message the bot
The trigger receives messages only while the scheme is on. Turn it on, message the bot and open the sheet: a new row appears at the bottom. If it does not, open the block result, the hint from Google is in error_message. An enabled scheme costs $0.0042 per hour.
- 6
Reply to the person
After the row is saved, add the Telegram message send block with the same token and chat_id from the trigger, and write something like "Request received". This way the client sees the message got through.
Pricing
A run of a Telegram block costs $0.001, a run of a Google Sheets block costs $0.001. Every month the balance is topped up to $3.50 for free, an enabled scheme costs $0.0042 per hour.
Services in this connection
- Telegram
Build a Telegram bot without code: reply to messages, add buttons, send leads and alerts to a chat, group or channel. Free balance every month, no card needed.
- Google Sheets
Send leads and orders to Google Sheets without code: append rows, find, read and update them by row number. Free balance every month, no card needed.
Frequently asked questions
Build your first scheme for free
Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.
Build it in the builder