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:

  • systemBooleanFunctions
  • systemScalarFunctions
  • systemObservableFunctions
  • systemAggregatedBooleanFunctions
  • systemAggregatedScalarFunctions
Deep Dive

How to limit provided Expression Functions

systemBooleanFunctions

Which Boolean Expression Functions are available

systemScalarFunctions

Which Scalar Expression Functions are available

systemObservableFunctions

Which Observable Expression Functions are available

systemAggregatedBooleanFunctions

Which Aggregated Boolean Expression Functions are available

systemAggregatedScalarFunctions

Which Aggregated Scalar Expression Functions are available

Limit By Module

To limit Expressions on a per Module basis use moduleExpressionFunctions in Expression Options.

moduleExpressionFunctions

Which Expressions Functions are available - specified by Module

Note

  • Functions defined in moduleExpressionFunctions inherit & override functions defined globally in systemXFunctions
  • e.g. if the Alert module only provides customised systemObservableFunctions, it inherits all other system functions (systemBooleanFunctions, systemScalarFunctions, etc.)
AdapTableQL: Limiting Functions
Fork

Expand to see the Expressions removed

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: true
Boolean
Whether a Column should be included in AdapTableQL Expressions

Note

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

AdapTableQL: Limiting Columns
Fork
  • In this example we have provided an implementation for the isColumnQueryable property to prevent these columns from being used in Expressions:
    • The License Column
    • All Date Columns

Expand to see how Queryable Columns were set

Try It Out
  • 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