FormTrigger Documentation
The FormTrigger
component enables the creation of custom web forms that can trigger workflows when submitted. This allows for user-friendly data collection through a dedicated form page that’s automatically generated based on your configuration.
Features
- Dynamic Form Generation: Automatically creates web forms based on configured fields
- Custom URL Endpoint: Provides a unique form URL that can be shared with users
- Form Customization: Configurable title, description, and form fields
- Field Validation: Enforces required fields and proper validation
- Multiple Field Types: Supports text, number, date, and boolean field types
Example of a form page:
Form Configuration
Form Settings
- Form URL: Unique URL where the form can be accessed
- Format:
{base-url}/form/{workflow-id}
- Can be copied to the clipboard using the “Copy URL” button
- Format:
- Form Title: Optional custom title for the form page
- If not provided, the workflow name will be used as the form title
- Form Description: Optional text providing context or instructions
- Displayed below the title on the form page
Field Configuration
Each form can have multiple fields that collect different types of information:
- Field Name: Identifier for the field (required)
- Used to reference the field value in workflow actions
- Field Type: Determines the input validation and UI presentation
- Text: Standard text input (default)
- Number: Numeric input only
- Yes/No: Boolean input
- Date: Date selection input
- Description: Label text shown to the user (required)
- Should clearly explain what information to enter
- Default Value: Optional pre-filled value for the field
Form States
The form page can display several different states:
- Active Form: When the workflow is active and properly configured
- Inactive Form: When the workflow exists but is set to inactive (displays a message indicating the form is unavailable)
- Error State: When configuration issues prevent the form from loading
- Success State: After successful submission, with option to submit another response
When a form is submitted:
- The FormService validates all required fields are present
- An execution context containing the form data is created
- A workflow outcome is generated and enqueued for processing
- The workflow actions can access form field values through parameter resolution