> ## 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.

# fields

> Lists the fields in the query.

## Syntax

```yaml theme={null}
query:
  fields:
    <view_name>.<field_name>: <optional_alias>
    <view_name>.<field_name>
    calc_1: <optional_alias>
    calc_2: <optional_alias>
```

## Properties

<ParamField path="query" type="object[]">
  An object containing the individual parameters that make up a query view's query definition.

  <Expandable title="query properties" defaultOpen="true">
    <ParamField path="fields" type="object">
      A list of field names in the query, specified as `view_name.field_name`. For date fields, append the time unit to the field name and enclose it in square brackets. For example, `users.created_at[year]`

      Add an alias to a field with `view_name.field_name: alias`
    </ParamField>
  </Expandable>
</ParamField>

## Examples

```yaml title="Fields with aliases" theme={null}
query:
  fields:
    users.age: age
    users.created_at[year]: created_at_year
    calc_1: age_plus_two
```

```yaml title="Fields without aliases" theme={null}
query:
  fields:
    users.age
    users.created_at[year]
    calc_1
```
