Advanced Options Features
This guide covers advanced patterns, complex configurations, and expert techniques for working with the Kodexa Options system. Once you’re comfortable with basic options, these patterns will help you build sophisticated, user-friendly configuration interfaces.Multi-Level Option Nesting
Options can be nested multiple levels deep to create hierarchical configuration structures:Best Practices for Nesting
- Limit depth to 3 levels - Deeper nesting becomes hard to navigate
- Use collapsible groups - Allow users to focus on relevant sections
- Clear naming hierarchy - Use consistent naming patterns (e.g.,
config,settings) - Document the structure - Provide examples showing the full path access
Dynamic Option Dependencies
Create complex conditional relationships between options:Example: Conditional Chains
Complex Conditional Logic
Dynamic Possible Values
Generate dropdown options dynamically based on other selections:Pattern: Filter Options Based on Selection
Pattern: Hierarchical Selection
Validation Patterns
Built-in Validation
Custom Validation in Code
Password and Secret Management
Organization Secrets Integration
Thestring option type with password: true integrates with organization secrets:
- Users can either type the password directly
- Or select from a dropdown of organization secrets
- Secret references are stored as
${secret.secretName} - At runtime, Kodexa resolves the reference to the actual secret value
- Centralized secret management
- No hardcoded credentials in configurations
- Easy rotation without updating all references
- Secure storage and access control
Tab-Based Organization
For components with many options, organize them into tabs:Real-World Examples
Example 1: SFTP Publishing Assistant
Example 2: Machine Learning Model Configuration
Example 3: Data Taxonomy with Properties
Performance Optimization
Lazy Loading for Option Dropdowns
For options that fetch data from APIs (likecloud-model, document-lookup):
Built-in features:
- Caching:
cloud-modelimplements 3-minute localStorage caching - Pagination: Results are paginated to avoid overwhelming the UI
- Search: Live search filters results as users type
- Use
showIfto delay loading heavy options until needed - Group related API-backed options to batch requests
- Set sensible page sizes (default: 50 for cloud models)
Conditional Loading Pattern
Accessibility and User Experience
Clear Labeling
Progressive Disclosure
Start simple, reveal complexity only when needed:Helpful Defaults
Contextual Help
Testing and Debugging
Validating Option Definitions
Testing Option Interactions
Migration and Versioning
Adding New Options (Backward Compatible)
Deprecating Options
Handling Migration in Code
Summary
Advanced options features enable:- Complex configurations through multi-level nesting
- Dynamic behavior with conditional visibility and dependencies
- User-friendly interfaces with progressive disclosure and clear guidance
- Secure credential management with organization secrets integration
- Performance optimization through lazy loading and caching
- Backward compatibility through careful versioning and migration strategies
Related Documentation
- Options Architecture: Understanding the options system
- Working with Options: Complete option type reference
- Defining an Assistant: Using options in assistants
