Forms & User Inputs
Learn how to collect information from users through questions, forms, and validated inputs.
Simple Questions
The most basic way to get input:
Ask Question Node
- Sends a question to the user
- Waits for their reply
- Saves their answer
- Continues the flow
| Setting | Example |
|---|---|
| Question | "What's your name?" |
| Save to | var.name |
Advanced Ask Node
For more control over user input:
Expecting Specific Types
| Type | What User Can Send |
|---|---|
text | Any text message |
number | Numbers only |
photo | A photo |
choice | Button selection |
any | Any input type |
Adding Validation
| Setting | Example |
|---|---|
| Expect | number |
| Validation | value > 0 && value < 120 |
| Error Message | "Please enter a valid age" |
Multi-Step Forms
When you need to collect multiple pieces of information:
Option 1: Chained Questions
Simple but can get messy with many fields.
Option 2: Form Node
A single node that handles multiple questions:
| Field | Question | Type |
|---|---|---|
name | "What's your name?" | text |
email | "What's your email?" | text |
age | "How old are you?" | number |
The Form node automatically:
- Asks each question in order
- Validates responses
- Stores all answers
- Provides a "Complete" output when done
Using Keyboards for Input
Instead of free text, give users buttons to click:
Reply Keyboard
┌─────────────────────────────┐
│ Choose an option: │
├──────────────┬──────────────┤
│ 📧 Email │ 📞 Phone │
├──────────────┴──────────────┤
│ ❌ Cancel │
└─────────────────────────────┘
Benefits:
- No typos
- Clear options
- Faster for users
Inline Buttons
Buttons attached to a message:
Would you like to continue?
[✅ Yes] [❌ No]
Validation Examples
Email Format
Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Error: "Please enter a valid email address"
Phone Number
Pattern: ^\+?[0-9]{10,15}$
Error: "Please enter a valid phone number"
Age Range
Expression: value >= 13 && value <= 120
Error: "Please enter a valid age"
Handling Invalid Input
When validation fails:
- Show an error message — Explain what's wrong
- Ask again — Give them another chance
- Offer help — Maybe a cancel option or example
Timeouts
What happens if the user never responds?
Setting a Timeout
Consider adding:
- A reminder after some time
- A graceful timeout message
- The ability to restart
Common Form Patterns
Registration Flow
Order Form
Tips
Keep It Short
Long forms have high drop-off rates. Ask only what you really need.
Show Progress
For long forms, tell users where they are: "Question 2 of 5"
Save As You Go
Save each answer immediately, so if the user leaves, you have partial data.
Always Offer an Exit
Give users a way to cancel or go back.
Next Steps
- Keyboards & Buttons → — Create interactive menus
- Expressions → — Write validation rules