# Column Scope Technical Reference

Canonical page: https://www.adaptabletools.com/docs/technical-reference-column-scope

-----------

## Column Scope

<ApiTypeCard name="ColumnScope" href="/docs/reference/columnscope" choice>

Which columns an object applies to. Set exactly one shape.

<ApiMember name="{ All: true }" href="/docs/reference/columnscope">

<ApiMemberType>

`true`

</ApiMemberType>

Matches every column. `All` must be `true`.

</ApiMember>

<ApiMember name="{ DataTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

`('text' | 'number' | 'boolean' | 'date' | 'textArray' | 'numberArray')[]`

</ApiMemberType>

Data types to match, for example `['number']` or `['text', 'textArray']`. Object, tuple and unknown columns are not scope data types. Name those columns with `ColumnIds`.

</ApiMember>

<ApiMember name="{ ColumnIds }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

Column ids to match. These are AG Grid `colId` values.

</ApiMember>

<ApiMember name="{ ColumnTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

AG Grid column type names, the strings set on `colDef.type`.

</ApiMember>

</ApiTypeCard>

-----------

## Column Scope API

| Method | Returns | Description |
| --- | --- | --- |
| [areAllBooleanColumnsInScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#areallbooleancolumnsinscope) | `boolean` | True if all selected columns are boolean |
| [createCellColorRangesForScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#createcellcolorrangesforscope) | [`CellColorRange`](https://www.adaptabletools.com/docs/reference/cellcolorrange.md)`[]` | Creates a default single `CellColorRange` for Styled Column wizards (Gradient,<br/>Percent Bar, Bullet Chart): `Col-Min` → `Col-Max` with neutral gray, matching<br/>the colour used when adding a range in the Ranges UI. If the column has no<br/>sample values yet, returns one `0` → `0` gray range. |
| [getAnyColumnIdForScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getanycolumnidforscope) | `string \| undefined` | Gets any ColumnId from the Scope |
| [getColumnIdsInScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getcolumnidsinscope) | `string[] \| undefined` | Returns all the ColumnIds in the Scope |
| [getColumnsInScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getcolumnsinscope) | [`AdaptableColumn`](https://www.adaptabletools.com/docs/reference/adaptablecolumn.md)`[]` | Returns list of all Columns in the given Scope |
| [getColumnTypesInScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getcolumntypesinscope) | `string[] \| undefined` | Returns all the ColumnTypes in the Scope |
| [getDataTypesInScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getdatatypesinscope) | `ScopeDataType[] \| undefined` | Returns all the DataTypes in the Scope |
| [getScopeDescription(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getscopedescription) | `string` | Provides a description for the Scope |
| [getScopeToString(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getscopetostring) | `string` | Gets string representation of the Scope |
| [getSingleColumnInScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#getsinglecolumninscope) | `string \| undefined` | Gets the only Column in given Scope |
| [isColumnInDateScope(column, scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#iscolumnindatescope) | `boolean` | True if Scope has Data DataType which contains Column |
| [isColumnInNumericScope(column, scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#iscolumninnumericscope) | `boolean` | True if Scope has Numeric DataType containing Column |
| [isColumnInScope(column, scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#iscolumninscope) | `boolean` | True if Column is in given Scope |
| [isColumnInScopeColumns(column, scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#iscolumninscopecolumns) | `boolean` | True if Column is in Scope&#39;s &#39;ColumnIds&#39; section |
| [isColumnInTextScope(column, scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#iscolumnintextscope) | `boolean` | True if Scope has text DataType containing Column |
| [isPrimaryKeyColumnInScopeColumns(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#isprimarykeycolumninscopecolumns) | `boolean` | Whether PK column is included in Scope&#39;s column section |
| [isScopeInScope(scopeA, scopeB)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#isscopeinscope) | `boolean` | True if first scope is in second Scope<br/><br/>Scope A \| Scope B \| Result<br/> ===========================================================================<br/> All * true<br/> * All true<br/> DataTypes DataTypes all DataTypes from A should be in B<br/> ColumnIds ColumnIds all ColumnIds from A should be in B<br/> ColumnIds DataTypes all DataTypes of ColumnIds from A should be in B<br/> DataTypes ColumnIds false |
| [isSingleBooleanColumnScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#issinglebooleancolumnscope) | `boolean` | True if Scope contains just 1 boolean Column |
| [isSingleColumnScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#issinglecolumnscope) | `boolean` | True if Scope contains just 1 ColumnId |
| [isSingleNumericColumnScope(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#issinglenumericcolumnscope) | `boolean` | True if Scope contains just 1 numeric Column |
| [scopeHasColumns(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#scopehascolumns) | `boolean` | True if Scope contains ColumnIds |
| [scopeHasColumnType(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#scopehascolumntype) | `boolean` | True if Scope contains ColumnTypes |
| [scopeHasDataType(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#scopehasdatatype) | `boolean` | True if Scope contains DataTypes |
| [scopeHasOnlyBooleanDataType(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#scopehasonlybooleandatatype) | `boolean` | True if Scope is DataTypes and contains just &#39;Boolean&#39; |
| [scopeIsAll(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#scopeisall) | `boolean` | True if Scope is &#39;All&#39; |
| [scopeIsEmpty(scope)](https://www.adaptabletools.com/docs/reference/columnscopeapi.md#scopeisempty) | `boolean` | True if Scope is empty |
