diff --git a/packages/nodes-base/nodes/Notion/GenericFunctions.ts b/packages/nodes-base/nodes/Notion/GenericFunctions.ts index 9de7d1842db17..2f625f6c13736 100644 --- a/packages/nodes-base/nodes/Notion/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Notion/GenericFunctions.ts @@ -320,6 +320,10 @@ function getDateFormat(includeTime: boolean) { return ''; } +function isEmpty(value: unknown): boolean { + return value === undefined || value === null || value === ''; +} + function getPropertyKeyValue( this: IExecuteFunctions, value: any, @@ -368,7 +372,16 @@ function getPropertyKeyValue( }; break; case 'multi_select': + if (isEmpty(value.multiSelectValue)) { + result = { + type: 'multi_select', + multi_select: [], + }; + break; + } + const multiSelectValue = value.multiSelectValue; + result = { type: 'multi_select', multi_select: (Array.isArray(multiSelectValue) @@ -403,6 +416,14 @@ function getPropertyKeyValue( }; break; case 'select': + if (isEmpty(value.selectValue)) { + result = { + type: 'select', + select: null, + }; + break; + } + result = { type: 'select', select: version === 1 ? { id: value.selectValue } : { name: value.selectValue },