diff --git a/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte b/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte index 2d5ac9bf8a..35e8c3c359 100644 --- a/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte @@ -223,11 +223,19 @@ } const displayRelationshipFields = relationship => { + const fields = {} for (const column of Object.entries(schema.columns) - .filter(([_, column]) => column.visible !== false) + .filter( + ([key, column]) => + column.visible !== false && + relationship[key] !== null && + relationship[key] !== undefined + ) .map(([key]) => key)) { - relationshipFields ??= {} - relationshipFields[column] = relationship[column] + fields[column] = relationship[column] + } + if (Object.keys(fields).length) { + relationshipFields = fields } }