Skip to content

Commit

Permalink
fix(Notion Node): Fix is_empty query on formula fields (n8n-io#8397)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsmr authored Jan 22, 2024
1 parent d597c2a commit 08e7db4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/nodes-base/nodes/Notion/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,16 @@ export function mapFilters(filtersList: IDataObject[], timezone: string) {
}

if (value.type === 'formula') {
const vpropertyName = value[`${camelCase(value.returnType as string)}Value`];
if (['is_empty', 'is_not_empty'].includes(value.condition as string)) {
key = value.returnType;
} else {
const vpropertyName = value[`${camelCase(value.returnType as string)}Value`];

return Object.assign(obj, {
['property']: getNameAndType(value.key as string).name,
[key]: { [value.returnType]: { [`${value.condition}`]: vpropertyName } },
});
return Object.assign(obj, {
['property']: getNameAndType(value.key as string).name,
[key]: { [value.returnType]: { [`${value.condition}`]: vpropertyName } },
});
}
}

return Object.assign(obj, {
Expand Down

0 comments on commit 08e7db4

Please sign in to comment.