Skip to main content

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

  1. Sends a question to the user
  2. Waits for their reply
  3. Saves their answer
  4. Continues the flow
SettingExample
Question"What's your name?"
Save tovar.name

Advanced Ask Node

For more control over user input:

Expecting Specific Types

TypeWhat User Can Send
textAny text message
numberNumbers only
photoA photo
choiceButton selection
anyAny input type

Adding Validation

SettingExample
Expectnumber
Validationvalue > 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:

FieldQuestionType
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:

  1. Show an error message — Explain what's wrong
  2. Ask again — Give them another chance
  3. 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