Budibase/budibase · error · Error

No view found

Error message

No view found

What it means

sdk.workspace.views.get for external datasources loads the datasource, finds the table, and searches its V2 views for one matching viewId. If no view with that ID exists on that table it throws a plain Error("No view found"). This happens when the view ID is wrong, the view was deleted, or the view belongs to a different table/datasource.

Source

Thrown at packages/server/src/sdk/workspace/views/external.ts:25

import * as utils from "../../../db/utils"
import { breakExternalTableId } from "../../../integrations/utils"
import {
  ensureQuerySet,
  ensureQueryUISet,
  ensureValidPrimaryDisplay,
} from "./utils"

export async function get(viewId: string): Promise<ViewV2> {
  const tableId = getTableIdFromViewId(viewId)

  const { datasourceId, tableName } = breakExternalTableId(tableId)
  const ds = await sdk.datasources.get(datasourceId)

  const table = ds.entities![tableName]
  const views = Object.values(table.views!).filter(isV2)
  const found = views.find(v => v.id === viewId)
  if (!found) {
    throw new Error("No view found")
  }
  return ensureQueryUISet(found)
}

export async function getEnriched(
  viewId: string
): Promise<ViewV2Enriched | undefined> {
  const tableId = getTableIdFromViewId(viewId)

  const { datasourceId, tableName } = breakExternalTableId(tableId)
  const ds = await sdk.datasources.get(datasourceId)

  const table = ds.entities![tableName]
  const views = Object.values(table.views!).filter(isV2)
  const found = views.find(v => v.id === viewId)
  if (!found) {
    return
  }

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Verify the viewId matches an existing V2 view: list the table's views and confirm the id
  2. Re-fetch the datasource/tables (sdk.datasources.get) so the view definitions are current before lookup
  3. Recreate the deleted view or update the caller to use the new view id
  4. Handle the undefined case with getEnriched instead of get if absence is expected

Example fix

// before
const view = await sdk.views.get(viewId)
// after
try {
  const view = await sdk.views.get(viewId)
} catch (e) {
  // view may have been deleted; fall back to listing current views
  const views = Object.values(table.views ?? {}).filter(isV2)
}
Defensive patterns

Strategy: try-catch

Validate before calling

const ds = await sdk.datasources.get(datasourceId)
const views = Object.values(ds.entities![tableName]?.views ?? {}).filter(isV2)
if (!views.some(v => v.id === viewId)) {
  // view missing - handle before calling get(viewId)
}

Try / catch

try {
  const view = await sdk.views.get(viewId)
} catch (e) {
  if (String(e.message) === "No view found") {
    // refresh view list / fall back to table-level data
  }
}

Prevention

When it happens

Trigger: Calling get(viewId) (or anything in its caller chain: components, user, data, integrationList, cachedParams, cachedGoto) with a viewId whose V2 view is not present in ds.entities[tableName].views - e.g. after the view was deleted or the datasource was refreshed and entities were re-fetched.

Common situations: Stale client-side references to a deleted view; a typo'd or malformed viewId that parses to the wrong table; saving the datasource changed view IDs; app referencing a view from before a datasource re-sync.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/9393cf0e4c1d85ff. Report an issue: GitHub.