diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 1fb785e6ef..35aecae66b 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -5332,10 +5332,6 @@ class BaseModelSqlv2 { const dataWithoutPks = []; for (const data of preparedDatas) { - if (!raw) { - await this.prepareNocoData(data, true, cookie); - } - const pkValues = this.extractPksValues(data); if (pkValues !== 'N/A' && pkValues !== undefined) { dataWithPks.push({ pk: pkValues, data }); @@ -5366,6 +5362,9 @@ class BaseModelSqlv2 { } } + await Promise.all(toInsert.map((d) => this.prepareNocoData(d, true, cookie))) + await Promise.all(toUpdate.map((d) => this.prepareNocoData(d, false, cookie))) + trx = await this.dbDriver.transaction(); const updatedPks = [];