---
title: "Retrieve a view"
method: GET
path: "/views/{viewId}"
tags: ["views"]
---

# Retrieve a view

`GET /views/{viewId}`

Lookup a view, this could be internal or external.

## Path parameters

- `viewId` string, required

## Headers

- `x-budibase-app-id` string, required

## Response `200`

Returns the retrieved view.

- ViewOutput
  - `data` object, required — The view to be created/updated.
    - `name` string, required — The name of the view.
    - `tableId` string, required — The ID of the table this view is based on.
    - `type` 'calculation' — The type of view - standard (empty value) or calculation.
    - `primaryDisplay` string — A column used to display rows from this view - usually used when rendered in tables.
    - `query` object — Search parameters for view
      - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
      - `onEmptyFilter` 'all' | 'none' — If no filters match, should the view return all rows, or no rows.
      - `groups` object[] — A grouping of filters to be applied.
        - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
        - `filters` object[] — A list of filters to apply
          - `operator` 'equal' | 'notEqual' | 'empty' | 'notEmpty' | 'fuzzy' | 'string' | 'contains' | 'notContains' | 'containsAny' | 'oneOf' | 'notOneOf' | 'range' — The type of search operation which is being performed.
          - `field` string — The field in the view to perform the search on.
          - `value` union — The value to search for - the type will depend on the operator in use.
            - string
            - number
            - boolean
            - object
        - `groups` object[] — A grouping of filters to be applied.
          - `logicalOperator` 'all' | 'any' — When using groups this defines whether all of the filters must match, or only one of them.
          - `filters` object[] — A list of filters to apply
            - `operator` 'equal' | 'notEqual' | 'empty' | 'notEmpty' | 'fuzzy' | 'string' | 'contains' | 'notContains' | 'containsAny' | 'oneOf' | 'notOneOf' | 'range' — The type of search operation which is being performed.
            - `field` string — The field in the view to perform the search on.
            - `value` union — The value to search for - the type will depend on the operator in use.
              - …
    - `sort` union
      - object
        - `field` string, required — The field from the table/view schema to sort on.
        - `order` 'ascending' | 'descending' — The order in which to sort.
        - `type` 'string' | 'number' — The type of sort to perform (by number, or by alphabetically).
      - object[]
        - `field` string, required — The field from the table/view schema to sort on.
        - `order` 'ascending' | 'descending' — The order in which to sort.
        - `type` 'string' | 'number' — The type of sort to perform (by number, or by alphabetically).
    - `schema` object, required
    - `id` string, required — The ID of the view.

---

[API](https://skmtc.net/budibase/apis/budibase-api.md) · [All operations](https://skmtc.net/budibase/apis/budibase-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/budibase/budibase-api/versions/9c6f16fc652b/schema)
