{"record":{"id":"c78d6374db1478cf","repo":"Budibase/budibase","slug":"unable-to-sort-by-field","errorCode":null,"errorMessage":"Unable to sort by ${field}","messagePattern":"Unable to sort by (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/rows/search/internal/sqs.ts","lineNumber":442,"sourceCode":"\n  if (params.sort) {\n    const resolveSortEntry = (\n      field: string,\n      direction?: SortOrder,\n      type?: SortType\n    ) => {\n      const isAggregateField = aggregations.some(agg => agg.name === field)\n      if (isAggregateField) {\n        return {\n          key: field,\n          direction: direction || SortOrder.ASCENDING,\n          type: type || SortType.NUMBER,\n        }\n      }\n\n      const sortField = table.schema[field]\n      if (!sortField) {\n        throw new Error(`Unable to sort by ${field}`)\n      }\n\n      const responseType = isStaticFormula(sortField)\n        ? sortField.responseType\n        : sortField.type\n      const sortType =\n        type ||\n        (responseType === FieldType.NUMBER ? SortType.NUMBER : SortType.STRING)\n\n      return {\n        key: mapToUserColumn(sortField.name),\n        direction: direction || SortOrder.ASCENDING,\n        type: sortType as SortType,\n      }\n    }\n\n    if (typeof params.sort === \"string\") {\n      const entry = resolveSortEntry(","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/rows/search/internal/sqs.ts#L424-L460","documentation":"Error \"Unable to sort by ${field}\" thrown in Budibase/budibase.","triggerScenarios":"Thrown at packages/server/src/sdk/workspace/rows/search/internal/sqs.ts:442 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}