Overview
Selection option formulas let you compute dropdown options dynamically at runtime instead of defining a static list. When a user opens a document, the formula evaluates for each data object and populates the dropdown with context-aware options. When referenced attributes change, the formula re-evaluates automatically and the dropdown updates in real time. Common use cases:- Load options from an external reference system via service bridges
- Filter options based on sibling attribute values (e.g., show subcategories for the selected category)
- Compute options based on document context
Configuration
Two properties on a taxon enable formula-driven options:Properties
When
true, the formula is used instead of the static selectionOptions list to populate the dropdown.JavaScript expression evaluated by the GoJA runtime. Must return an array of options (see Return Format below).
You can define both static
selectionOptions and a selectionOptionFormula on the same taxon. The formula takes precedence when useSelectionOptionFormula is true. This is useful for having a fallback list during development.Return Format
The formula must return an array. Two formats are accepted: Object format (recommended):null or an empty array [] clears the dropdown options. The distinction is preserved: null means “no data available” while [] means “explicitly empty list.”
How It Works
Key points:- Options are computed and persisted on the DataObject (not the attribute) — they survive page reloads
- Change detection uses canonical JSON comparison (sorted keys) to avoid unnecessary updates
- During initial load, events are suppressed to prevent a flood — the UI reads options from the WASM layer directly
- After initial load, real-time changes emit
selectionOptions:computedevents that update the UI reactively
Referencing Sibling Attributes
Formulas can read the current data object’s attribute values to parameterize API calls:Service Bridge Integration
Most selection option formulas call a service bridge to fetch options from an external system:serviceBridgeCall() function is a convenience wrapper available in formula contexts. For the full service bridge API, see Calling Service Bridges from Scripts.
Grid Child Formulas
When a SELECTION taxon is a child of a group (grid row), the formula evaluates per data object instance. Each row can have different dropdown options based on its own attribute values:Examples
Simple lookup
Simple lookup
Fetch a static reference list from an external system on document open.
Dependent dropdown
Dependent dropdown
Filter team members based on a selected department. When the user changes the department, the contact dropdown updates automatically.
Multi-dependency with fallback
Multi-dependency with fallback
Use multiple attributes as dependencies and provide a fallback when the external call returns nothing.
