Form Builder Guide
Overview
The Platform Form Builder provides a streamlined way to create and integrate forms into your application. This guide covers the CLI command usage, template structure, and implementation process.
CLI Command
platform add-form
This command initiates the form creation process with the following workflow:
- Displays the portal menu for form location selection
- Prompts for the form name
- Generates the form structure
- Offers wizard integration options
Template Structure
The form generation process utilizes three main template components:
1. Builder Template (forms/_TEMPLATE/builder.tsx)
- Contains the Form Field Selector interface
- Allows visual form construction
- Provides field configuration options
2. Client Template (forms/_TEMPLATE/client.tsx)
- Houses the implemented form code
- Generated from the Builder selections
- Handles form rendering and client-side logic
3. Server Template (forms/_TEMPLATE/server.tsx)
- Manages dynamic server-side operations
- Handles data processing and validation
- Configures backend integrations
Video Demonstration
Watch this comprehensive video guide to see the Form Builder in action:
This video demonstrates:
- Using the Form Field Selector
- Configuring form fields and properties
- Implementing client and server templates
- Testing the completed form
Implementation Steps
1. Form Generation
- Run the
platform add-formcommand - Select the target menu location
- Provide a name for your form
- Choose whether to integrate with a wizard
2. Form Building
- Navigate to the Form Field Selector (right side panel)
- Select desired form controls from available options
- Configure each field's properties:
- Validation rules
- Field labels
- Default values
- Required/Optional status
- Preview the form layout
- Copy the generated code
3. Implementation
- Replace the content in the client template with the copied code
- Configure server-side logic in the server template
- Test form functionality:
- Validate all form fields
- Verify error handling
- Test data submission flow
4. Wizard Integration (Optional)
If wizard integration was selected:
- Choose the target wizard step
- The form will be automatically integrated into the wizard flow
- Additional wizard-specific configurations may be required
Best Practices
- Remove the implementation guide component after setup
- Implement comprehensive form validation
- Include proper error handling
- Verify the complete data submission flow
- Test wizard integration thoroughly if implemented