Expression UI Components

View as Markdown

Summary

  • AdapTable provides 3 UI Components to help write and inspect Expressions:
    • Query Builder - UI-based editor (mainly dropdowns) for Boolean conditions
    • Expression Editor - full editor for hand-written and complex Expressions
    • Formula Editor - Formula Trace popup and Compact Editor for Calculated Columns
  • All 3 validate as you work — an invalid Expression cannot be run or saved

AdapTable provides 3 User Interface components for working with Expressions.

Note

  • An AdapTableQL Expression is ultimately just a human-readable string and can, therefore, be written by hand
  • Expressions provided in Initial Adaptable State might often be hand-produced

Each component is designed to deal with different levels of user proficiency and complexity of use case:

ComponentBest ForTypical Use
Query BuilderBoolean conditions built from dropdowns
Expression EditorHand-written and complex ExpressionsAll Expression-based Modules
Formula EditorInspecting and inline-editing a formulaCalculated Columns

Find Out More

New to AdapTableQL? Read the AdapTableQL Getting Started Guide

Validation

All 3 Expression UI Components validate as you work.

An invalid Expression cannot be run or saved.

  • Expression Editor — live underlines, error messages, and a Result preview
  • Query Builder — flags issues on the Output Expression; will not open an Expression it cannot display
  • Formula Editor — live status in the Compact Editor; Grid cells show #INVALID until the formula is corrected

Hint

Managing Expression Components

The Query Builder and Expression Editor can both be used wherever a Boolean Expression is edited.

By default both are offered, and the Query Builder opens first.

This is configured via 2 properties in editorOptions on Expression Options:

  • availableEditors — which editors are shown (Query Builder, Expression Editor, or both)
  • defaultEditor — which tab opens first when both are available

Note

  • These options do not apply to the Formula Editor, which is used only for Calculated Column formulae
  • Nor do they apply to Column Filters and Badge Style rules, which always use a Query Builder fixed to their Column

editorOptions.availableEditors

Default: ['QueryBuilder', 'ExpressionEditor']
Which Editors are available for Boolean Expressions
Expression Editor only
Fork
  • This demo sets availableEditors to ['ExpressionEditor'] so the Query Builder is never offered and never available (there is no Query Builder tab)
Loading demo…

editorOptions.defaultEditor

Default: 'QueryBuilder'
Which editor opens first when both are available
Expression Editor opens first
Fork
  • This demo keeps both editors available, but sets defaultEditor to 'ExpressionEditor'
  • The Grid Filter Settings Panel opens automatically on the Expression Editor tab
Try It Out
  • Note the Expression Editor is the selected tab
  • Switch to the Query Builder tab — both editors are still available
Loading demo…