# Enrollment Template The enrollment template demonstrates how to build a complete data collection workflow that gathers user information step-by-step, validates inputs, confirms details, and saves the data. ## Topic: User Registration & Data Collection This template is perfect for: - Customer onboarding flows - Event registrations - Lead capture forms - Survey collection - Application submissions ## The Code ```basic REM Enrollment Tool Example PARAM name AS string LIKE "Abreu Silva" DESCRIPTION "Required full name of the individual." PARAM birthday AS date LIKE "23/09/2001" DESCRIPTION "Required birth date of the individual in DD/MM/YYYY format." PARAM email AS string LIKE "abreu.silva@example.com" DESCRIPTION "Required email address for contact purposes." PARAM personalid AS integer LIKE "12345678900" DESCRIPTION "Required Personal ID number of the individual (only numbers)." PARAM address AS string LIKE "Rua das Flores, 123 - SP" DESCRIPTION "Required full address of the individual." DESCRIPTION "This is the enrollment process, called when the user wants to enrol." REM Start enrollment TALK "Welcome to the enrollment process! Let's get you registered." TALK "First, what is your full name?" HEAR name TALK "Thank you. What is your birth date? (DD/MM/YYYY)" HEAR birthday TALK "What is your email address?" HEAR email TALK "Please provide your Personal ID number (numbers only):" HEAR personalid TALK "Finally, what is your full address?" HEAR address REM Validate and confirm TALK "Please confirm your details:" TALK "Name: " + name TALK "Birth Date: " + birthday TALK "Email: " + email TALK "Personal ID: " + personalid TALK "Address: " + address TALK "Are these details correct? (yes/no)" HEAR confirmation IF confirmation = "yes" THEN SAVE "enrollments.csv", name, birthday, email, personalid, address TALK "Thank you! Your enrollment has been successfully submitted." ELSE TALK "Let's start over with the correct information." END IF ``` ## Sample Dialogs These conversations show how the enrollment template works in real-world scenarios. ### Dialog 1: Successful Enrollment
Today
### Dialog 2: User Corrects Information
User continues with corrected information...
### Dialog 3: LLM-Assisted Natural Input When using the LLM, users can provide information naturally:
## Keywords Used | Keyword | Purpose | |---------|---------| | `PARAM` | Define expected input parameters with types and examples | | `DESCRIPTION` | Provide context for LLM understanding | | `TALK` | Send messages to the user | | `HEAR` | Wait for and capture user input | | `IF/ELSE` | Conditional logic for confirmation | | `SAVE` | Persist data to CSV file | ## How It Works 1. **Parameter Definition**: The `PARAM` declarations tell the LLM what information to collect 2. **Step-by-Step Collection**: Each `HEAR` captures one piece of data 3. **Confirmation Loop**: User reviews all data before submission 4. **Data Persistence**: `SAVE` stores the validated data ## Customization Ideas ### Add Validation ```basic HEAR email IF NOT INSTR(email, "@") THEN TALK "Please enter a valid email address" HEAR email END IF ``` ### Add to Database Instead of CSV ```basic INSERT "users", name, birthday, email, personalid, address ``` ### Send Confirmation Email ```basic SEND MAIL email, "Welcome!", "Your registration is complete, " + name ``` ## Related Templates - [start.bas](./start.md) - Basic greeting flow - [auth.bas](./auth.md) - Authentication patterns ---