> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# query_all_views_and_fields

> Controls whether the AI can query any view in the model or only views organized within topics.

When enabled, the [Omni Agent](/ai/chat) and [Workbook Agent](/ai/queries) can generate queries on any view in the model, not just views that are organized within [topics](/modeling/topics). This is useful when you have ad-hoc tables that users want to query without creating a dedicated topic for each one.

<Tip>
  For curated, self-service analytics, organize your views into [topics](/modeling/topics) and keep `query_all_views_and_fields` disabled. Topics provide better structure, improved performance, and a more guided experience for users.
</Tip>

## Syntax

```yaml theme={null}
ai_settings:
  query_all_views_and_fields: <enabled | disabled | default>
```

## Properties

<ParamField path="ai_settings" type="object">
  An object that contains various AI settings. See [`ai_settings`](/modeling/models/parameters/ai-settings) for more information.

  <Expandable title="ai_settings properties" defaultOpen="true">
    <ParamField path="query_all_views_and_fields" type="string" default="default">
      <Note>
        If your instance was created **on or before** March 5, 2026, the default behavior is `disabled`. Instances created after this date are `enabled` by default.
      </Note>

      Controls whether the [Omni Agent](/ai/chat) and [Workbook Agent](/ai/queries) can generate queries on any view in the model, not just views that are organized within [topics](/modeling/topics).

      Must be one of the following:

      * `default` - Uses Omni's default behavior (`enabled`)
      * `disabled` - The AI can only query views organized within topics
      * `enabled` - The AI can query any view in the model. This means:
        * The AI can use any view in the model as a starting point for queries
        * The AI can discover and join other views that are related to the selected view
        * Users don't need to specify a topic when asking the AI to generate queries

      <Tip>
        When using the [Generate a query API](/api/ai/generate-a-query), this setting must be enabled and the `queryAllViews` parameter must be set to `true` to allow querying views outside of topics. The Omni Agent and Workbook Agent in the UI apply this behavior automatically when the setting is enabled.
      </Tip>
    </ParamField>
  </Expandable>
</ParamField>

## Examples

```yaml title="Enable querying all views" theme={null}
ai_settings:
  query_all_views_and_fields: enabled
```

```yaml title="Restrict AI to topic views only" theme={null}
ai_settings:
  query_all_views_and_fields: disabled
```
