Budibase/budibase · error · HTTPError
You can't hide "${view.primaryDisplay}" because it is the di
Error message
You can't hide "${view.primaryDisplay}" because it is the display column. What it means
checkDisplayField ensures the table's primary display column is always visible in the view. Hiding the display column would break row identification in the UI, so a 400 HTTPError is thrown when view.schema[primaryDisplay].visible is falsy while primaryDisplay is set.
Source
Thrown at packages/server/src/sdk/workspace/views/index.ts:282
}
if (viewSchema[field].readonly) {
if (!viewSchema[field].visible) {
throw new HTTPError(
`Field "${field}" must be visible if you want to make it readonly`,
400
)
}
}
}
}
function checkDisplayField(view: Omit<ViewV2, "id" | "version">) {
if (view.primaryDisplay) {
const viewSchemaField = view.schema?.[view.primaryDisplay]
if (!viewSchemaField?.visible) {
throw new HTTPError(
`You can't hide "${view.primaryDisplay}" because it is the display column.`,
400
)
}
}
}
function checkRequiredFields(
table: Table,
view: Omit<ViewV2, "id" | "version">
) {
const existingView = table.views?.[view.name] as ViewV2 | undefined
for (const field of Object.values(table.schema)) {
if (!helpers.schema.isRequired(field.constraints)) {
continue
}
const viewSchemaField = view.schema?.[field.name]View on GitHub (pinned to a81a902e9a)
Solutions
- Set visible: true for view.schema[view.primaryDisplay].
- If the column must be hidden, change the table's primary display column to another field first.
- If primaryDisplay is no longer needed in the view, unset view.primaryDisplay.
Example fix
// before view.schema[view.primaryDisplay].visible = false // after view.schema[view.primaryDisplay].visible = true
Defensive patterns
Strategy: validation
Validate before calling
if (view.primaryDisplay && view.schema?.[view.primaryDisplay]?.visible !== true) {
view.schema[view.primaryDisplay].visible = true
} Type guard
function displayVisible(view: Omit<ViewV2, "id" | "version">): boolean {
return !view.primaryDisplay || view.schema?.[view.primaryDisplay]?.visible === true
} Try / catch
try {
await sdk.views.update(view)
} catch (e) {
if (e instanceof HTTPError && e.status === 400 && e.message.includes("because it is the display column")) {
view.schema[view.primaryDisplay].visible = true
await sdk.views.update(view)
} else { throw e }
} Prevention
- Exclude primaryDisplay from bulk hide operations
- Check the table's primary display before generating visibility flags
- Re-check display visibility after changing the table's display column
When it happens
Trigger: create/update via guardViewSchema with view.primaryDisplay set and view.schema[primaryDisplay] either missing visible or visible:false.
Common situations: Bulk-hiding columns in the builder including the display column; copying view config that hides the display field; scripts that set visible flags without checking primaryDisplay.
Related errors
- Grouping by fields of type "${targetSchema.type}" is not sup
- Calculation fields are not allowed in non-calculation views
- Field "${field}" is not valid for the requested table
- Field "${field}" must be visible if you want to make it read
- You can't hide "${field.name}" because it is a required fiel
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/ecd6a2c1815af352.
Report an issue: GitHub.