Named Query Technical Reference

View as Markdown

Named Query State

NamedQueryState

Named Query section of Adaptable State, including Initial State.

Each query is a scalar AdapTableQL expression other expressions can call with QUERY('Name'). Aggregations are not allowed. ReturnType defaults to 'boolean', which can be used as a Grid Filter or Alert rule.

Extends

BaseState

Named Queries other expressions can reference with QUERY('Name').

Named Query

NamedQuery

Defines a Query which can be referenced in AdaptableQL Expressions

Optional description of what the query computes;
shown in the Expression Editor lookups and Named Query views.

AdapTableQL Expression evaluated per row (scalar; aggregations are not allowed in Named Queries)

Name

string

Name of the Query, used to reference it in AdaptableQL Expressions

Return type of the expression. When omitted, the query is treated as 'boolean' and can be used as a Grid Filter or Alert rule.

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

ReturnType is a NamedQueryReturnType:

Value
'boolean'
'number'
'text'
'date'
'numberArray'
'textArray'

Note

  • A Named Query's Expression can resolve to any value (Boolean, number, text or date)
  • Only Named Queries which resolve to a Boolean can be loaded as a Grid Filter
  • Scalar Named Queries can be referenced (via QUERY) anywhere a value is expected - e.g. in Calculated Columns

Named Query API

NamedQueryApi

Named Queries saved in AdapTable State, and running a query by object or by name.

Adds several Named Queries to Adaptable State.

Adds a new Named Query to Adaptable State

Gets all Named Queries in Adaptable State

Retrieves Named Query with given name from State

Retrieves Query section from Adaptable State

isValidNamedQuery(namedQuery)
returns

NamedQueryValidationResult

Whether this Named Query can be saved. The name is required and must not already be used.

Opens Settings Panel with Query section selected and visible

Runs the given Named Query

Runs Named Query which has given name