diff --git a/packages/server/src/api/controllers/row/utils/sqlUtils.ts b/packages/server/src/api/controllers/row/utils/sqlUtils.ts index 19f251bef3..b67ef6be92 100644 --- a/packages/server/src/api/controllers/row/utils/sqlUtils.ts +++ b/packages/server/src/api/controllers/row/utils/sqlUtils.ts @@ -150,10 +150,19 @@ export async function buildSqlFieldList( table = source } - for (let field of Object.values(table.schema)) { + for (const field of Object.values(table.schema)) { if (field.type !== FieldType.LINK || !relationships || !field.tableId) { continue } + + if ( + isView && + source.schema?.[field.name] && + !helpers.views.isVisible(source.schema[field.name]) + ) { + continue + } + const { tableName } = breakExternalTableId(field.tableId) if (tables[tableName]) { fields = fields.concat(extractRealFields(tables[tableName], fields))