Budibase/budibase · error · HTTPError
Grouping by fields of type "${targetSchema.type}" is not sup
Error message
Grouping by fields of type "${targetSchema.type}" is not supported What it means
Thrown by guardCalculationViewSchema when a calculation view declares a group-by field whose table schema type is not in the set of types that support grouping (via canGroupBySchema). Budibase views can only group by certain field types (e.g. strings, options); grouping by types like JSON, attachments, or formulas is rejected with a 400. It is a static config validation, not a runtime data failure.
Source
Thrown at packages/server/src/sdk/workspace/views/index.ts:208
throw new HTTPError(
`Calculation field "${name}" references field "${schema.field}" which is not a numeric field`,
400
)
}
}
const groupByFields = helpers.views.basicFields(view)
for (const groupByFieldName of Object.keys(groupByFields)) {
const targetSchema = table.schema[groupByFieldName]
if (!targetSchema) {
throw new HTTPError(
`Group by field "${groupByFieldName}" does not exist in the table schema`,
400
)
}
if (!canGroupBySchema(targetSchema)) {
throw new HTTPError(
`Grouping by fields of type "${targetSchema.type}" is not supported`,
400
)
}
}
}
async function guardViewSchema(
tableId: string,
view: Omit<ViewV2, "id" | "version">
) {
const table = await sdk.tables.getTable(tableId)
if (helpers.views.isCalculationView(view)) {
await guardCalculationViewSchema(table, view)
} else {
if (helpers.views.hasCalculationFields(view)) {
throw new HTTPError(View on GitHub (pinned to a81a902e9a)
Solutions
- Change the groupBy field in the view to one whose type is supported (e.g. string, number, boolean, option).
- If the field must stay, change the table column type to a groupable type or add a supported computed/text column to group on.
- Remove the groupBy from the view if grouping is not essential.
- Check canGroupBySchema in packages/server for the exact supported type list before configuring.
Example fix
// before
view.groupBy = "metadata" // metadata: { type: "json" }
// after
view.groupBy = "status" // status: { type: "string" } Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = ["string", "number", "boolean", "longform", "options"]
if (view.groupBy && !SUPPORTED.includes(table.schema[view.groupBy]?.type)) {
throw new Error(`Cannot group by ${view.groupBy}`)
}
await sdk.views.create(view) Type guard
function isGroupable(field: FieldSchema | undefined): boolean {
return !!field && ["string", "number", "boolean", "longform", "options"].includes(field.type)
} Try / catch
try {
await sdk.views.update(view)
} catch (e) {
if (e instanceof HTTPError && e.status === 400 && e.message.includes("Grouping by fields of type")) {
view.groupBy = undefined
await sdk.views.update(view)
} else { throw e }
} Prevention
- Check canGroupBySchema / supported types before assigning groupBy
- Filter the group-by picker in UIs to supported field types
- Re-validate view configs after changing table column types
When it happens
Trigger: Creating or updating a calculation view (sdk.views.create/update -> guardViewSchema) with view.groupBy set to a field whose table.schema[fieldName].type is unsupported by canGroupBySchema.
Common situations: Grouping by a formula, JSON, multi-select, attachment, or link field added to the table after the view was configured; copying view configs between tables with different field types; UI workarounds that bypass type filtering.
Related errors
- 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 "${view.primaryDisplay}" because it is the di
- 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/14d9ca9294f64eec.
Report an issue: GitHub.