diff --git a/packages/client/src/components/app/forms/BBReferenceField.svelte b/packages/client/src/components/app/forms/BBReferenceField.svelte
index 87bc015f93..7d11ff5525 100644
--- a/packages/client/src/components/app/forms/BBReferenceField.svelte
+++ b/packages/client/src/components/app/forms/BBReferenceField.svelte
@@ -1,11 +1,9 @@
-
+
diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte
index 6402ccbe2d..d054a4a558 100644
--- a/packages/client/src/components/app/forms/RelationshipField.svelte
+++ b/packages/client/src/components/app/forms/RelationshipField.svelte
@@ -17,6 +17,7 @@
export let onChange
export let filter
export let datasourceType = "table"
+ export let primaryDisplay
let fieldState
let fieldApi
@@ -25,6 +26,9 @@
let searchTerm
let open
+ $: type =
+ datasourceType === "table" ? FieldTypes.LINK : FieldTypes.BB_REFERENCE
+
$: multiselect = fieldSchema?.relationshipType !== "one-to-many"
$: linkedTableId = fieldSchema?.tableId
$: fetch = fetchData({
@@ -45,7 +49,7 @@
: flatten(fieldState?.value)?.[0]
$: component = multiselect ? CoreMultiselect : CoreSelect
$: expandedDefaultValue = expand(defaultValue)
- $: primaryDisplay = tableDefinition?.primaryDisplay
+ $: primaryDisplay = primaryDisplay || tableDefinition?.primaryDisplay
let optionsObj = {}
let initialValuesProcessed
@@ -162,7 +166,7 @@
{disabled}
{validation}
defaultValue={expandedDefaultValue}
- type={FieldTypes.LINK}
+ {type}
bind:fieldState
bind:fieldApi
bind:fieldSchema