Skip to main content
Options are a powerful feature in Kodexa that allow you to define configuration parameters for components, capture user input, and enable flexible customization of behavior. They provide a declarative way to create configuration interfaces without writing UI code.

Quick Start

Options appear throughout Kodexa in metadata definitions for assistants, models, taxonomies (data definitions), actions, and pipeline steps. Here’s a simple example:
This creates two configuration fields that users can fill in, and the values are passed to your code at runtime.

How Users Experience Options

Options create interactive configuration interfaces in several areas:

Assistant Configuration

When users add an assistant to their project, they can configure it through options you define: Working with Options 1

Document Labeling Properties

When labeling documents, users can set properties on labels based on options defined in your taxonomy: Working with Options 2 Options keep users focused on content while configuring the system to their needs.

Complete Option Types Reference

Kodexa supports 24+ option types organized into categories:

Basic Input Types

string / text

A text input field with optional multiline support.
Configuration:
  • lines (number): Number of lines for multiline input (default: 1)
  • password (boolean): Mask input as password field (default: false)
  • placeholder (string): Placeholder text when empty
Special Features:
  • Password fields integrate with organization secrets
  • Automatically switches between text input and textarea based on lines
  • Secret references stored as ${secret.secretName}
Example with multiline:

number

Numeric input with optional constraints.
Configuration:
  • min (number): Minimum allowed value
  • max (number): Maximum allowed value
  • step (number): Increment/decrement step (default: 1)

boolean

Checkbox or toggle switch for true/false values.
Special Features:
  • View mode displays color-coded badges (green for true, gray for false)
  • Can specify custom labels for true/false states

select

Dropdown selection from predefined values.
Configuration:
  • possibleValues: Array of {label, value} objects
  • multiple (boolean): Allow multiple selections (default: false)

Code & Script Types

code

Full code editor with syntax highlighting.
Configuration:
  • language (string): Programming language for syntax highlighting (default: “python”)
  • height (string): Editor height (default: “300px”)
Special Features:
  • Full code editor experience
  • View mode renders as formatted <pre> block
  • Scrollable with max-height in view mode

script / pythonScript / javascript

Script input for code snippets.

Platform Resource Types

documentStore

Select a document store from the project.

moduleStore

Select a module store from the project.

tableStore

Select a data store from the project.

taxonomyStore

Select a taxonomy (data definition) from the project.

workspace

Select a workspace from available workspaces.
Configuration:
  • showDescription (boolean): Show workspace description (default: true)

Document & Content Types

document

Search and select a specific document.
Special Features:
  • Live search with autocomplete
  • Shows document path in results
  • Returns storeRef/documentId format
  • Configurable page size for results

data-form

Select a data form configuration from the project.

Taxonomy & Label Types

taxon

Select a taxonomy element (data element).
Configuration:
  • onlyGroups (boolean): Show only group taxons (default: false)
  • allowEmpty (boolean): Allow empty selection (default: true)
  • filterable (boolean): Enable filtering (default: true)
Special Features:
  • Hierarchical taxonomy navigation
  • Case-insensitive search across label and parent label
  • Custom dropdown item rendering

taxon_label

Select a taxonomy label.

taxon-lookup

Hierarchical taxonomy search with full path display.
Configuration:
  • taxonomyTypes (array): Types of taxonomies to include (default: [“CONTENT”, “MODEL”])
  • showFullPath (boolean): Show full taxonomy path (default: true)
Special Features:
  • Flattens taxonomy tree for search
  • Displays full path with parent labels
  • Chip-based display with custom styling
  • Excludes METADATA value paths

taxon_with_properties

Select a taxonomy element and configure its properties.
Configuration:
  • taxonomyTypes (array): Types of taxonomies to include
  • additionalOptions (array): Nested options for the selected taxon
Special Features:
  • Two-tier configuration (selection + properties)
  • Tabbed interface for additional options
  • Recursive option rendering
  • Stores both tag path and options object

Status Types

documentStatus

Select a document status from the project.

attributeStatus

Select an attribute status from the project.
Configuration:
  • clearable (boolean): Allow clearing the selection (default: true)

taskStatus

Select a task status from the project.
Special Features:
  • Color-coded badges with dynamic background colors
  • Contrasting text color based on background
  • Custom item rendering in dropdown

task-templates

Select a task template from the project.
Special Features:
  • Async data loading from project store
  • Reactive updates when templates change

Cloud AI Model Types

cloud-model

Select a cloud-based AI model.
Configuration:
  • showDescription (boolean): Show model description as hint (default: true)
  • showProvider (boolean): Show provider in model name (default: true)
Special Features:
  • Local storage caching (3-minute expiry) to reduce API calls
  • Filters non-embedding active models
  • Combines model name + provider for display
  • Alphabetically sorted
  • Paginated results (pageSize: 50)

cloud-embedding

Select a cloud embedding model.
Configuration:
  • showDescription (boolean): Show model description (default: true)
Special Features:
  • Filters for embedding models specifically
  • API integration with pagination
  • Dynamic loading state

Pipeline Types

pipeline

Configure an entire pipeline with steps.
Special Features:
  • Visual pipeline editor
  • Drag-and-drop step ordering
  • Step configuration interface

pipelineModelOptions

Configure options for models within a pipeline.
Configuration:
  • showTabs (boolean): Organize options in tabs (default: true)

Display Types

alert

Display an informational alert message.
Configuration:
  • markdown (text): Markdown content to display
  • type (select): Alert style - info, warning, error, success
Special Features:
  • Renders markdown content
  • Dynamic styling based on alert type
  • Material Design icons

article

Display or reference a knowledge base article.
Configuration:
  • articleId (string): ID of the article to display
  • text (text): Direct text content (alternative to articleId)
  • slide (number): Specific slide number to display
Special Features:
  • Integrates with knowledge base
  • Slide-based navigation support
  • Can display by ID or direct text

Specialized Types

chart

Select chart visualization type.
Configuration:
  • type (select): Chart type - bar or pie

label

Select or enter a document label.
Configuration:
  • multiple (boolean): Allow multiple label selection (default: false)
Special Features:
  • Fetches available labels from project
  • Custom item rendering
  • Supports future multi-select capability

simpleExpression

Enter a simple expression that can be evaluated.
Special Features:
  • Single-line text input
  • Can be evaluated to compute a value

Working with Lists and Objects

Two of the most powerful option types are list and object, which allow you to define complex, structured data. Understanding how to use these properly is critical for building flexible configurations.

List Options

Lists allow you to define arrays of values, either simple strings or complex objects. Use type: list with the listType parameter to specify what kind of items the list contains.

String Lists

For lists of simple string values, use type: list with listType: string:
Key points:
  • type: list indicates this is an array
  • listType: string specifies array items are strings
  • default should be an array of strings
  • Users can add/remove items through the UI
Resulting value in code:

Object Lists

For lists of complex objects, use type: list with listType: object and define the object structure using groupOptions:
Key points:
  • type: list indicates this is an array
  • listType: object specifies array items are objects
  • groupOptions defines the schema for each object in the array
  • default should be an array of objects matching the schema
  • Each object in the default must conform to the groupOptions structure
Resulting value in code:

Nested Lists in Objects

You can nest lists within objects for complex hierarchical structures:
Resulting structure:

Object Options

Objects allow you to group related options together. Use type: object with groupOptions to define the object’s properties.

Simple Object

Key points:
  • type: object indicates this is a structured object
  • groupOptions defines the properties of the object
  • properties.collapsible: true makes the group collapsible in the UI
  • Each property in groupOptions follows the same option structure
Resulting value in code:

Nested Objects

Objects can contain other objects for deep hierarchical structures:
Best Practice: Limit nesting to 2-3 levels maximum for better user experience.

Default Value Structures

Default values must match the type structure:

Examples of Correct Default Values

Anti-Patterns to Avoid

❌ DON’T: Use text fields for lists

✅ DO: Use proper list type

Why this matters:
  • Lists provide structured data that’s easy to validate
  • Users get proper UI controls (add/remove buttons)
  • Code receives properly typed arrays, not strings that need parsing
  • Validation and error handling are automatic

❌ DON’T: Use text for structured data

✅ DO: Use object type

❌ DON’T: Mix default value structure with type

✅ DO: Match default structure to type

Real-World Example: Comprehensive Configuration

Here’s a complete example showing lists, objects, and nesting:
Accessing this in code:

Option Groups

Options can be nested into groups for better organization and user experience:
Benefits of grouping:
  • Organizes related options together
  • Can be made collapsible to reduce UI clutter
  • Creates a hierarchy of configuration
  • Improves user experience for complex configurations
Properties for groups:
  • collapsible: true - Makes the group expandable/collapsible in the UI

Providing Possible Values

Limit user input to specific choices using possibleValues:
This creates a dropdown with only these four options. Users cannot enter free-form text.

Conditional Visibility

Use showIf to show/hide options based on other values:
The username and password options only appear when use_authentication is checked. showIf syntax:
  • JavaScript expression evaluated against current option values
  • Access other options via this.optionName
  • Supports boolean logic: &&, ||, !
  • Comparison operators: ===, !==, >, <, >=, <=
Complex example:

Developer-Only Options

Hide advanced options from regular users:
Options marked with developerOnly: true are only visible to users who have enabled “Show Developer Tools” in their settings.

Feature Flags

Gate options behind feature flags:
The option only appears if the specified feature flag is enabled for the project or organization.

Common Option Properties

All options support these common properties:

Best Practices

1. Provide Clear Labels and Descriptions

2. Use Appropriate Types

Match the option type to the kind of data you’re collecting:
Important: For lists and structured data, use proper list and object types instead of text fields. See the Anti-Patterns section in “Working with Lists and Objects” for detailed examples.

3. Set Sensible Defaults

5. Use Required Judiciously

Only mark options as required: true if the component truly cannot function without them:

6. Leverage Conditional Visibility

Keep the UI clean by hiding irrelevant options:

Using Options in Code

Python (Assistants/Modules)

Validation Example

Summary

Options are Kodexa’s declarative configuration system. By defining options in metadata, you:
  • Enable user configuration without writing UI code
  • Provide type-safe input with automatic validation
  • Create consistent experiences across all components
  • Capture custom information tailored to your needs
  • Keep configuration co-located with component definitions
The Options system supports 24+ different types, from simple text inputs to complex taxonomy selectors with nested properties. Master options to build flexible, user-configurable components that integrate seamlessly into the Kodexa platform.