diff --git a/packages/nc-gui/utils/formulaUtils.ts b/packages/nc-gui/utils/formulaUtils.ts index aac7611cf9..abe03d1d19 100644 --- a/packages/nc-gui/utils/formulaUtils.ts +++ b/packages/nc-gui/utils/formulaUtils.ts @@ -482,7 +482,7 @@ const formulas: Record = { rqd: 0, }, }, - description: 'Returns an empty string.', + description: 'Returns a blank value.', syntax: 'BLANK()', examples: ['BLANK()'], }, diff --git a/packages/nocodb/src/db/functionMappings/pg.ts b/packages/nocodb/src/db/functionMappings/pg.ts index 427454d13b..2105f19dcf 100644 --- a/packages/nocodb/src/db/functionMappings/pg.ts +++ b/packages/nocodb/src/db/functionMappings/pg.ts @@ -201,7 +201,9 @@ const pg = { const pattern = (await fn(pt.arguments[1])).builder; return { builder: knex.raw( - `REGEXP_MATCHES(${source}::text, ${pattern}::text) ${colAlias}`, + // use `SUBSTRING` since REGEXP_MATCH returns array value + // `REGEXP_MATCH(${source}::text, ${pattern}::text) ${colAlias}`, + `SUBSTRING(${source}::text from ${pattern}::text) ${colAlias}`, ), }; },