# NamedQuery

Canonical page: https://www.adaptabletools.com/docs/reference/namedquery

Defines a Query which can be referenced in AdaptableQL Expressions

```ts title="TypeScript"
export interface NamedQuery extends AdaptableObject 
```

###### Extends

[`AdaptableObject`](https://www.adaptabletools.com/docs/reference/adaptableobject.md)

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [Description](https://www.adaptabletools.com/docs/reference/namedquery.md#description) | `string` | Optional description of what the query computes;<br/>shown in the Expression Editor lookups and Named Query views. |
| [Expression](https://www.adaptabletools.com/docs/reference/namedquery.md#expression) | `string` | AdapTableQL Expression evaluated per row (scalar; aggregations are not allowed in Named Queries) |
| [Name](https://www.adaptabletools.com/docs/reference/namedquery.md#name) | `string` | Name of the Query, used to reference it in AdaptableQL Expressions |
| [ReturnType](https://www.adaptabletools.com/docs/reference/namedquery.md#returntype) | [`NamedQueryReturnType`](https://www.adaptabletools.com/docs/reference/namedqueryreturntype.md) | 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](https://www.adaptabletools.com/docs/reference/namedquery.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |

## Property Details

### Description

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

```ts title="TypeScript"
Description?: string;
```

###### Property Value

`string`

### Expression

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

```ts title="TypeScript"
Expression: string;
```

###### Property Value

`string`

### Name

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

```ts title="TypeScript"
Name: string;
```

###### Property Value

`string`

### ReturnType

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

```ts title="TypeScript"
ReturnType?: NamedQueryReturnType;
```

###### Property Value

[`NamedQueryReturnType`](https://www.adaptabletools.com/docs/reference/namedqueryreturntype.md)

### IsReadOnly

> *Inherited from [AdaptableObject](https://www.adaptabletools.com/docs/reference/adaptableobject.md)*

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;)

```ts title="TypeScript"
IsReadOnly?: boolean;
```

###### Property Value

`boolean`
