diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts index 52dfcfd97a..a16892296d 100644 --- a/packages/server/src/api/controllers/row/external.ts +++ b/packages/server/src/api/controllers/row/external.ts @@ -18,7 +18,10 @@ import { import sdk from "../../../sdk" import * as utils from "./utils" import { dataFilters } from "@budibase/shared-core" -import { inputProcessing } from "../../../utilities/rowProcessor" +import { + inputProcessing, + outputProcessing, +} from "../../../utilities/rowProcessor" import { cloneDeep, isEqual } from "lodash" export async function handleRequest( @@ -121,7 +124,8 @@ export async function find(ctx: UserCtx): Promise { ctx.throw(404) } - return row + const table = await sdk.tables.getTable(tableId) + return await outputProcessing(table, row) } export async function destroy(ctx: UserCtx) { diff --git a/packages/server/src/sdk/app/rows/search/external.ts b/packages/server/src/sdk/app/rows/search/external.ts index 447d1d7d16..14ef4ec4fd 100644 --- a/packages/server/src/sdk/app/rows/search/external.ts +++ b/packages/server/src/sdk/app/rows/search/external.ts @@ -17,6 +17,7 @@ import { utils } from "@budibase/shared-core" import { ExportRowsParams, ExportRowsResult } from "../search" import { HTTPError, db } from "@budibase/backend-core" import pick from "lodash/pick" +import { outputProcessing } from "../../../../utilities/rowProcessor" export async function search(options: SearchParams) { const { tableId } = options @@ -75,6 +76,9 @@ export async function search(options: SearchParams) { rows = rows.map((r: any) => pick(r, fields)) } + const table = await sdk.tables.getTable(tableId) + rows = await outputProcessing(table, rows) + // need wrapper object for bookmarks etc when paginating return { rows, hasNextPage, bookmark: bookmark && bookmark + 1 } } catch (err: any) {