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 6c20ec4089..a87241315d 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 @@ -1552,8 +1552,9 @@ class BaseModelSqlv2 { switch (colOptions.type) { case RelationTypes.BELONGS_TO: { - const parentCol = await colOptions.getChildColumn(); - insertObj[parentCol.column_name] = + const childCol = await colOptions.getChildColumn(); + const parentCol = await colOptions.getParentColumn(); + insertObj[childCol.column_name] = nestedData?.[parentCol.title]; } break;