How to build a Telegram form bot for data collection
By the Botable team
A Telegram form bot asks form questions one at a time in a chat, validating each answer as it arrives and saving progress. Describe your fields and validation rules and Botable builds the flow and the export.
What is a form bot?
A Telegram form bot completes at a materially higher rate than the equivalent web form for a structural reason: a form presents every field at once, so abandonment costs all the answers, while a conversation asks one question at a time, so abandonment costs only the remainder. Building one well comes down to three things. Validate at the point of answer, not on submit, so a mistyped email is corrected while the person is still thinking about it. Persist each answer as it arrives, which turns a drop-out into a partial response you can still use and lets someone resume days later from where they stopped. And use buttons for every closed question, because free text where a choice was intended creates cleaning work that outlasts whatever the form was for. Registrations, applications, intake and surveys all fit this shape.
What commands does it have?
| Command | What it does |
|---|---|
/start | Begins the form, or resumes an unfinished one |
/back | Returns to the previous question |
/status | How far through the respondent is |
/responses | Admin view of submissions |
/export | Sends the responses as a CSV |
What do you need before you start?
- A Telegram bot token from @BotFather
- Your fields, which are required, and the validation rule for each
- Where the results should go, and who is allowed to read them
How do you build it?
Why validate each answer immediately?
Because correcting a mistyped email eight questions later means finding it, and most people will not. Ask for per-answer validation with a plain-language error and a re-ask — the correction then costs one message instead of a lost submission.
How does resuming work?
Each answer is written as it arrives against a session for that user, so /start on a later day picks up at the next unanswered question. Ask for it explicitly; a form that restarts from the beginning after an interruption is one nobody finishes.
When should a question use buttons?
Whenever the set of valid answers is known. Free text for a closed question guarantees you will receive "UK", "U.K.", "united kingdom" and "England" for the same field, and cleaning that afterwards costs more than defining the buttons did.
How do you get the data out?
A CSV export for the whole set and a per-response view for individual follow-up, plus optional posting to an API as each response completes. Decide who may run the export — respondent data is exactly the thing that should not be readable by everyone in a group.
A prompt you can use as-is
Paste this into Botable and adjust the details. It is specific on purpose — a vague description produces a vague bot.
Build a form bot for event registration. Ask one question at a time: full name, email, ticket type (buttons: standard, student, group), dietary requirements (buttons plus an Other free-text option), and whether they want the newsletter (yes/no buttons). Validate the email format at the moment it is answered and re-ask with a plain explanation if it fails. Save each answer as it arrives so a partial response is kept and /start resumes where they stopped. /back returns one question. On completion, confirm with a summary and a reference number. /export sends a CSV, restricted to admins.
Who is this bot for?
- Event registration where the audience is already in Telegram
- Application and intake processes that need a real completion rate
- Any survey longer than three questions
What goes wrong with this kind of bot?
- Validating on submit instead of per answer is where completions are lost
- Without per-answer persistence an interruption destroys the whole response
- Restrict the export — respondent data readable by a whole group is a privacy incident
Questions about form bots
Can it accept file uploads?
Yes — documents and photos can be attached to a response, which suits applications needing a CV or a receipt. Say what file types you expect and what size limit applies.
How is this different from a poll bot?
A poll collects one answer from many people and cares about the aggregate; a form collects many answers from one person and cares about each response individually. That difference decides the storage, so build the one you actually need.