diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 1b6aa477d3..b153c8f7d0 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -9886,6 +9886,18 @@ export function extractFilterFromXwhere( return []; } + // if array treat it as `and` group + if (Array.isArray(str)) { + // calling recursively for nested query + return str.map((s) => + extractFilterFromXwhere(s, aliasColObjMap, throwErrorIfInvalid), + ); + } else if (typeof str !== 'string' && throwErrorIfInvalid) { + throw new Error( + 'Invalid filter format. Expected string or array of strings.', + ); + } + let nestedArrayConditions = []; let openIndex = str.indexOf('((');