Reducing Expression Complexity
Summary
- AdapTable allows developers to reduce the AdapTableQL functionality on offer to users
- This is often the case if you are evaluating Expressions yourself externally instead of using AdapTableQL
- In particular 2 features are provided:
- Make some Expression Functions unavailable in the Expression Editor and for AdapTableQL evaluation
- Specify that certain Columns cannot be included in Expressions
AdapTable provides a couple of helpful features to reduce the complexity of the Expressions available to users.
Hint
This is particularly useful if you are evaluating Expressions on the Server using your own translation
Limiting Available AdapTableQL Functions
By default all Expression Functions are available in the Expression Editor and available for the AdapTableQL evaluation engine.
Multiple properties in Expression Options can be used to limit the functions which the user can access.
Note
Similarly developers can limit which Predicates are available in Filters
These can be divided into 2 groups:
- Limit by Function Type
- Limit by Module
Limit By Function Type
To limit Expressions globally for each distinct Function Expression Type use:
systemBooleanFunctionssystemScalarFunctionssystemObservableFunctionssystemAggregatedBooleanFunctionssystemAggregatedScalarFunctions
Deep Dive
How to limit provided Expression Functions
systemBooleanFunctions
systemScalarFunctions
systemObservableFunctions
systemAggregatedBooleanFunctions
systemAggregatedScalarFunctions
Limit By Module
To limit Expressions on a per Module basis use moduleExpressionFunctions in Expression Options.
moduleExpressionFunctions
Note
- Functions defined in
moduleExpressionFunctionsinherit & override functions defined globally insystemXFunctions - e.g. if the
Alertmodule only provides customisedsystemObservableFunctions, it inherits all other system functions (systemBooleanFunctions,systemScalarFunctions, etc.)
Limiting Queryable Columns
By default all Columns in AdapTable can be used in a Query.
To specify whether or not a given column is Queryable, provide an implementation for the isColumnQueryable property of Expression Options.
isColumnQueryable
Default: trueBooleanNote
If no implementation is provided, all Columns can be used in Expressions
Hint
Use filter and floatingFilter properties in GridOptions to set which Columns can be filtered
- In this example we have provided an implementation for the
isColumnQueryableproperty to prevent these columns from being used in Expressions:- The
LicenseColumn - All
DateColumns
- The
Expand to see how Queryable Columns were set
- Open the Expression Editor (e.g. by clicking the arrows in the Query toolbar) and note that License and all Date Columns are absent from the Column list