diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index f5d04ebffe..7e8733105f 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -197,7 +197,7 @@ class BaseModelSqlv2 { ): Promise { const { where, ...rest } = this._getListArgs(args as any); const qb = this.dbDriver(this.tnPath); - await this.selectObject({ qb, validateFormula }); + await this.selectObject({ ...args, qb, validateFormula }); const aliasColObjMap = await this.model.getAliasColObjMap(); const sorts = extractSortsObject(rest?.sort, aliasColObjMap); diff --git a/packages/nocodb/src/services/datas.service.ts b/packages/nocodb/src/services/datas.service.ts index 01c663cee8..fac808d099 100644 --- a/packages/nocodb/src/services/datas.service.ts +++ b/packages/nocodb/src/services/datas.service.ts @@ -186,7 +186,7 @@ export class DatasService { }); const data = await baseModel.findOne({ ...args, dependencyFields }); - return data ? await nocoExecute(ast, data, {}, {}) : {}; + return data ? await nocoExecute(ast, data, {}, dependencyFields) : {}; } async getDataGroupBy(param: { model: Model; view: View; query?: any }) { @@ -272,9 +272,9 @@ export class DatasService { dbDriver: await NcConnectionMgrv2.get(base), }); - const { ast } = await getAst({ model, query, view }); + const { ast, dependencyFields } = await getAst({ model, query, view }); - const listArgs: any = { ...query }; + const listArgs: any = { ...dependencyFields }; try { listArgs.filterArr = JSON.parse(listArgs.filterArrJson); } catch (e) {}