diff --git a/packages/nc-gui/utils/dataUtils.ts b/packages/nc-gui/utils/dataUtils.ts index 0451161908..dc03cbb218 100644 --- a/packages/nc-gui/utils/dataUtils.ts +++ b/packages/nc-gui/utils/dataUtils.ts @@ -29,7 +29,7 @@ export const extractPkFromRow = (row: Record, columns: ColumnType[] const pkCols = columns.filter((c: Required) => c.pk) // if multiple pk columns, join them with ___ and escape _ in id values with \_ to avoid conflicts if (pkCols.length > 1) { - pkCols.map((c: Required) => row?.[c.title]?.toString?.().replaceAll('_', '\\_') ?? null).join('___') + return pkCols.map((c: Required) => row?.[c.title]?.toString?.().replaceAll('_', '\\_') ?? null).join('___') } else if (pkCols.length) { return row?.[pkCols[0].title] ?? null } diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index cef6a5a490..c08b622595 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -10230,7 +10230,7 @@ export function getCompositePkValue(primaryKeys: Column[], row) { if (typeof row !== 'object') return row; if (primaryKeys.length > 1) { - primaryKeys.map((c) => + return primaryKeys.map((c) => (row[c.title] ?? row[c.column_name])?.toString?.().replaceAll('_', '\\_'), ); }