diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index d83f3bf9a7..74bba33baa 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -127,10 +127,7 @@ let fromPrimary $: { if (!fromPrimary && fromTable) { - const relationshipKey = fromRelationship?.fieldName - fromPrimary = - fromTable.primary.filter(val => val === relationshipKey)[0] || - fromTable.primary[0] + fromPrimary = fromRelationship?.foreignKey } } $: isManyToMany =