diff --git a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts index 647c6ef601..cb0d72ceab 100644 --- a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts @@ -1517,10 +1517,10 @@ class BaseModelSqlv2 { const res = {}; let view: View; - let fields: string[] = []; + let fields: string[]; if (fieldsSet?.size) { - viewOrTableColumns = await this.model.getColumns(); + viewOrTableColumns = _columns || (await this.model.getColumns()); } else { view = await View.get(viewId); const viewColumns = viewId && (await View.getColumns(viewId));