ExpressionOptions
Options for managing Expressions in AdapTable's Query Language
export interfaceProperties
| Property | Type | Description | Default |
|---|---|---|---|
| caseSensitiveExpressions | boolean | Perform case-sensitive text comparisons when evaluating Expressions | false |
| customAggregatedFunctions | Record<string,AggregatedExpressionFunction> | ((context:GlobalExpressionFunctionsContext<string>) => Record<string,AggregatedExpressionFunction>) | Bespoke Aggregated Expression Functions — to complement those provided by AdapTable (Calculated Column Aggregated / Alert Aggregated). Omit category (or set 'Aggregation') to list under the AggregationFunctions-menu section; any other string creates a section with that name. Use isAvailable with to limitmodules (Alert / Calculated Column only — not Layout Row Summary or Cell Summary). Toolbar chips still use expressionEditorButtons.The reducer receives currentValue as the computed input for thatrow (the aggregation's input expression, not necessarily a raw column cell). aggColumnId is set only when the input is a bare column ref.A name registered in both customStandardFunctions and this map is adual name: NAME() is row-wise, NAME{…} is the aggregation.Extra constants are positional args; per-row logic is a customscalar used as the input. Every aggregation accepts GROUP_BY and WHERE. Further clauses arecapabilities the definition declares: cumulative (acceptCUMULATIVE([orderCol]) — a running value per row), weight (acceptWEIGHT([col]), delivered as weightValue) and returnType (staticresult type for Calculated Column data type / type checks). Declared capabilities are picked up automatically by validation, the Expression Editor clause chips, the Cumulative editor and the Query Builder. extends is not supported for aggregations. | undefined (none) |
| customStandardFunctions | Record<string,AdaptableCustomExpressionFunctionEntry> | ((context:GlobalExpressionFunctionsContext<ScalarFunctionName>) => Record<string,AdaptableCustomExpressionFunctionEntry>) | Bespoke Standard Expression Functions — to complement those provided by AdapTable. “Standard” matches the Expression Editor (vs Aggregated). Registers both value-producing functions and boolean predicates. A custom function is treated as a boolean predicate (usable as a filter or alert condition) only when it declares returnType: 'boolean' — predicatesMUST set that property. returnType is required; use a value fromEXPRESSION_RETURN_TYPES ('boolean' | 'number' | 'string' | 'date' |'object' | 'null' | 'any'). Set category to a value from EXPRESSION_CATEGORIES (e.g. 'date','general', 'custom') so the function appears in the matching ExpressionEditor menu. Omit category (or use 'custom') for the Custom menu; anyother string creates a menu with that name. Entries are flat objects combining the AQL evaluation props ( handler, returnType, operands, docs) with the Adaptablepresentation / availability props ( label, icon, isAvailable, …) —see AdaptableCustomExpressionFunction. Alternatively an entry may bean AdaptableCustomExpressionFunctionWithExtends partial that inheritsmetadata from a system (or previously registered custom) function via extends — useful when overriding a system operator such as IS_BLANKwhile keeping its label / icon / operands. Boolean predicates stay Expression-Editor-only unless they declare returnType: 'boolean' and operands with arity 1 or 2 (column-only, orcolumn + value). Optional label is used in the operator picker.operands of arity 0 / 3+ do not appear in Query Builder / ColumnFilter.Toolbar chips are separate: use expressionEditorButtons (same as forsystem functions). | undefined (none) |
| displayColumnFriendlyNamesForExpressions | boolean | Reference a Column's Header (i.e. FriendlyName) in all Expression overviews (instead of ColumnId) | true |
| editorOptions | ExpressionEditorOptions | Which UI editors are available for Boolean Expressions, and which opens first | |
| evaluateAdaptableQLExternally | (context:EvaluateExpressionExternallyContext<TData>) => boolean | Whether a Module (or specific expression) should be evaluated by AdaptableQL | All Modules are evaluated by AdapTable |
| evaluateDatesUsingTime | boolean | ((context:AdaptableColumnContext) => boolean) | Whether date comparisons use the full timestamp (exact instant) rather than the calendar day. Affects the IN operator on date columns wherever Expressions are evaluated(Queries, Styled Columns, Alerts, Column Filters, ...): true compares the exactdatetime, false compares the calendar day. Also controls whether the date ColumnFilter's distinct-value tree drills down to individual times. When an IN right-hand value is an ISO string containing T, the exact instant is used regardless. | false |
| expressionEditorButtons | (context:ExpressionEditorButtonsContext) =>ExpressionEditorButton[] | Customise the function/operator chips shown above the Expression Editor. Called per editor surface with AdapTable's defaultButtons for that type.Return those unchanged to keep defaults, or amend/replace them (useful when adding chips for customStandardFunctions / customAggregatedFunctions).Editor types are intentionally coarse (e.g. standard covers both booleanand scalar editors; aggregated covers aggregated scalar and aggregatedboolean) so callers are not forced to treat those as separate concepts. Only chips whose function is available for the current Module are rendered. | undefined (use AdapTable defaults for each editor type) |
| fields | AdaptableField[] | ((context:AdaptableFieldContext) =>AdaptableField[]) | Fields are items in Data Source that are NOT columns but can be used in Expressions (via FIELD keyword) | |
| isColumnQueryable | (queryableColumnContext:QueryableColumnContext) => boolean | Can a given column be included in Expressions | undefined (all columns can be used in Expressions) |
| isExpressionFunctionAvailable | (context:GlobalExpressionFunctionAvailabilityContext) => boolean | Whether an Expression Function is available in a given Module (or Column). Called for each Expression Function and Module combination; return trueto make the function available or false to hide it. The context includesdefaultAvailability (whether the function would be available by default),which can be returned to keep the standard behaviour. For Column Filter operators the callback is additionally invoked per-Column with context.column (and context.columnScope) set, so adifferent operator set can be offered per Column. column is undefinedfor the module-level pass, so guard on it before applying per-Column logic. Hiding a function never disables a symbol operator: hiding SUM removesSUM(…) but + still works (likewise = / EQ, > / GT, ? : / IF).Keyword operators ( CONTAINS, IN, CASE, …) are hidden with their function.Structural functions ( COL, FIELD, QUERY, DATE, $SCOPE, NULL,VAR, TRUE, FALSE, AND, OR, NOT) cannot be hidden; returningfalse for them is ignored (and logs a warning). | undefined (all functions have their default availability) |
| liveRefreshIntervalMs | number | Repaint cadence (in milliseconds) for cells whose rules depend on the clock ( NOW(), IS_PAST(), ROW_AGE{}) or on a sliding window (WITHIN(...)).0 disables the live refresh — such cells only repaint on data changes. | 1000 |
| maxHistoryPerCell | number | Ring-buffer capacity per cell for the observable functions (CHANGE_COUNT,NET_CHANGE, HIGHEST, PREVIOUS, …): how many changes of one cell areretained for LAST_N / cumulative reads. Also the LAST_N(n) ceiling. | 1000 |
| maxTimeframeSize | number | Maximum time (in milliseconds) to hold a Data Change event in a trailing timeframe | 28800000 (~8 hours) |
| performExpressionValidation | boolean | Validate Expressions before they can be run or saved | true |
| queryVariables | QueryVariable[] | Query variables that can be referenced in Expressions via VAR('name').Each variable has a name, a static or resolver value, and an optional description. Evaluated synchronously with each expression evaluation. | |
| supportedAstContractVersions | number[] | AST contract versions a ServerSideRowModel / remote evaluator accepts. Absent means v1 only (raw parse tree). Include 2 to receivenormalized contract-v2 ASTs from expressionApi.getASTForExpression. |
Property Details
caseSensitiveExpressions
Perform case-sensitive text comparisons when evaluating Expressions
caseSensitiveExpressions?: boolean;Default Value
false
Property Value
boolean
customAggregatedFunctions
Bespoke Aggregated Expression Functions — to complement those provided by AdapTable (Calculated Column Aggregated / Alert Aggregated).
Omit category (or set 'Aggregation') to list under the Aggregation
Functions-menu section; any other string creates a section with that name.
Use isAvailable with to limit
modules (Alert / Calculated Column only — not Layout Row Summary or Cell
Summary). Toolbar chips still use expressionEditorButtons.
The reducer receives currentValue as the computed input for that
row (the aggregation's input expression, not necessarily a raw column
cell). aggColumnId is set only when the input is a bare column ref.
A name registered in both customStandardFunctions and this map is a
dual name: NAME() is row-wise, NAME{…} is the aggregation.
Extra constants are positional args; per-row logic is a custom
scalar used as the input.
Every aggregation accepts GROUP_BY and WHERE. Further clauses are
capabilities the definition declares: cumulative (accept
CUMULATIVE([orderCol]) — a running value per row), weight (accept
WEIGHT([col]), delivered as weightValue) and returnType (static
result type for Calculated Column data type / type checks). Declared
capabilities are picked up automatically by validation, the Expression
Editor clause chips, the Cumulative editor and the Query Builder.
extends is not supported for aggregations.
customAggregatedFunctions?: Record<string, AggregatedExpressionFunction> | ((context: GlobalExpressionFunctionsContext<string>) => Record<string, AggregatedExpressionFunction>);Default Value
undefined (none)
Property Value
Record<string,AggregatedExpressionFunction> | ((context:GlobalExpressionFunctionsContext<string>) => Record<string,AggregatedExpressionFunction>)
customStandardFunctions
Bespoke Standard Expression Functions — to complement those provided by AdapTable. “Standard” matches the Expression Editor (vs Aggregated).
Registers both value-producing functions and boolean predicates. A custom
function is treated as a boolean predicate (usable as a filter or alert
condition) only when it declares returnType: 'boolean' — predicates
MUST set that property. returnType is required; use a value from
EXPRESSION_RETURN_TYPES ('boolean' | 'number' | 'string' | 'date' |
'object' | 'null' | 'any').
Set category to a value from EXPRESSION_CATEGORIES (e.g. 'date',
'general', 'custom') so the function appears in the matching Expression
Editor menu. Omit category (or use 'custom') for the Custom menu; any
other string creates a menu with that name.
Entries are flat objects combining the AQL evaluation props
(handler, returnType, operands, docs) with the Adaptable
presentation / availability props (label, icon, isAvailable, …) —
see AdaptableCustomExpressionFunction. Alternatively an entry may be
an AdaptableCustomExpressionFunctionWithExtends partial that inherits
metadata from a system (or previously registered custom) function via
extends — useful when overriding a system operator such as IS_BLANK
while keeping its label / icon / operands.
Boolean predicates stay Expression-Editor-only unless they declare
returnType: 'boolean' and operands with arity 1 or 2 (column-only, or
column + value). Optional label is used in the operator picker.
operands of arity 0 / 3+ do not appear in Query Builder / ColumnFilter.
Toolbar chips are separate: use expressionEditorButtons (same as for
system functions).
customStandardFunctions?: Record<string, AdaptableCustomExpressionFunctionEntry> | ((context: GlobalExpressionFunctionsContext<ScalarFunctionName>) => Record<string, AdaptableCustomExpressionFunctionEntry>);Default Value
undefined (none)
Property Value
Record<string,AdaptableCustomExpressionFunctionEntry> | ((context:GlobalExpressionFunctionsContext<ScalarFunctionName>) => Record<string,AdaptableCustomExpressionFunctionEntry>)
displayColumnFriendlyNamesForExpressions
Reference a Column's Header (i.e. FriendlyName) in all Expression overviews (instead of ColumnId)
displayColumnFriendlyNamesForExpressions?: boolean;Default Value
true
Property Value
boolean
editorOptions
Which UI editors are available for Boolean Expressions, and which opens first
editorOptions?: ExpressionEditorOptions;Property Value
evaluateAdaptableQLExternally
Whether a Module (or specific expression) should be evaluated by AdaptableQL
evaluateAdaptableQLExternally?: (context: EvaluateExpressionExternallyContext<TData>) => boolean;Default Value
All Modules are evaluated by AdapTable
Property Value
(context:EvaluateExpressionExternallyContext<TData>) => boolean
evaluateDatesUsingTime
Whether date comparisons use the full timestamp (exact instant) rather than the calendar day.
Affects the IN operator on date columns wherever Expressions are evaluated
(Queries, Styled Columns, Alerts, Column Filters, ...): true compares the exact
datetime, false compares the calendar day. Also controls whether the date Column
Filter's distinct-value tree drills down to individual times.
When an IN right-hand value is an ISO string containing T, the exact instant is used regardless.
evaluateDatesUsingTime?: boolean | ((context: AdaptableColumnContext) => boolean);Default Value
false
Property Value
boolean | ((context:AdaptableColumnContext) => boolean)
expressionEditorButtons
Customise the function/operator chips shown above the Expression Editor.
Called per editor surface with AdapTable's defaultButtons for that type.
Return those unchanged to keep defaults, or amend/replace them (useful when
adding chips for customStandardFunctions / customAggregatedFunctions).
Editor types are intentionally coarse (e.g. standard covers both boolean
and scalar editors; aggregated covers aggregated scalar and aggregated
boolean) so callers are not forced to treat those as separate concepts.
Only chips whose function is available for the current Module are rendered.
expressionEditorButtons?: (context: ExpressionEditorButtonsContext) => ExpressionEditorButton[];Default Value
undefined (use AdapTable defaults for each editor type)
Property Value
(context:ExpressionEditorButtonsContext) =>ExpressionEditorButton[]
fields
Fields are items in Data Source that are NOT columns but can be used in Expressions (via FIELD keyword)
fields?: AdaptableField[] | ((context: AdaptableFieldContext) => AdaptableField[]);Property Value
AdaptableField[] | ((context:AdaptableFieldContext) =>AdaptableField[])
isColumnQueryable
Can a given column be included in Expressions
isColumnQueryable?: (queryableColumnContext: QueryableColumnContext) => boolean;Default Value
undefined (all columns can be used in Expressions)
Property Value
(queryableColumnContext:QueryableColumnContext) => boolean
isExpressionFunctionAvailable
Whether an Expression Function is available in a given Module (or Column).
Called for each Expression Function and Module combination; return true
to make the function available or false to hide it. The context includes
defaultAvailability (whether the function would be available by default),
which can be returned to keep the standard behaviour.
For Column Filter operators the callback is additionally invoked
per-Column with context.column (and context.columnScope) set, so a
different operator set can be offered per Column. column is undefined
for the module-level pass, so guard on it before applying per-Column logic.
Hiding a function never disables a symbol operator: hiding SUM removes
SUM(…) but + still works (likewise = / EQ, > / GT, ? : / IF).
Keyword operators (CONTAINS, IN, CASE, …) are hidden with their function.
Structural functions (COL, FIELD, QUERY, DATE, $SCOPE, NULL,
VAR, TRUE, FALSE, AND, OR, NOT) cannot be hidden; returning
false for them is ignored (and logs a warning).
isExpressionFunctionAvailable?: (context: GlobalExpressionFunctionAvailabilityContext) => boolean;Default Value
undefined (all functions have their default availability)
Property Value
(context:GlobalExpressionFunctionAvailabilityContext) => boolean
liveRefreshIntervalMs
Repaint cadence (in milliseconds) for cells whose rules depend on the clock
(NOW(), IS_PAST(), ROW_AGE{}) or on a sliding window (WITHIN(...)).
0 disables the live refresh — such cells only repaint on data changes.
liveRefreshIntervalMs?: number;Default Value
1000
Property Value
number
maxHistoryPerCell
Ring-buffer capacity per cell for the observable functions (CHANGE_COUNT,
NET_CHANGE, HIGHEST, PREVIOUS, …): how many changes of one cell are
retained for LAST_N / cumulative reads. Also the LAST_N(n) ceiling.
maxHistoryPerCell?: number;Default Value
1000
Property Value
number
maxTimeframeSize
Maximum time (in milliseconds) to hold a Data Change event in a trailing timeframe
maxTimeframeSize?: number;Default Value
28800000 (~8 hours)
Property Value
number
performExpressionValidation
Validate Expressions before they can be run or saved
performExpressionValidation?: boolean;Default Value
true
Property Value
boolean
queryVariables
Query variables that can be referenced in Expressions via VAR('name').
Each variable has a name, a static or resolver value, and an optional description.
Evaluated synchronously with each expression evaluation.
queryVariables?: QueryVariable[];Property Value
supportedAstContractVersions
AST contract versions a ServerSideRowModel / remote evaluator accepts.
Absent means v1 only (raw parse tree). Include 2 to receive
normalized contract-v2 ASTs from expressionApi.getASTForExpression.
supportedAstContractVersions?: number[];Property Value
number[]