diff --git a/packages/nodes-base/nodes/Notion/GenericFunctions.ts b/packages/nodes-base/nodes/Notion/GenericFunctions.ts index df54434d28..de91bc3083 100644 --- a/packages/nodes-base/nodes/Notion/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Notion/GenericFunctions.ts @@ -136,7 +136,7 @@ export function formatText(content: string) { } function getLink(text: { textLink: string, isLink: boolean }) { - if (text.isLink === true) { + if (text.isLink === true && text.textLink !== '') { return { link: { url: text.textLink, @@ -270,10 +270,12 @@ function getPropertyKeyValue(value: any, type: string, timezone: string) { }; break; case 'date': + //&& value.dateStart !== 'Invalid date' && value.dateEnd !== 'Invalid date' if (value.range === true) { result = { type: 'date', date: { start: moment.tz(value.dateStart, timezone).utc().format(), end: moment.tz(value.dateEnd, timezone).utc().format() }, }; + //if (value.date !== 'Invalid date') } else { result = { type: 'date', date: { start: moment.tz(value.date, timezone).utc().format(), end: null }, diff --git a/packages/nodes-base/nodes/Notion/Notion.node.ts b/packages/nodes-base/nodes/Notion/Notion.node.ts index 78b3cf921a..5ae5325d77 100644 --- a/packages/nodes-base/nodes/Notion/Notion.node.ts +++ b/packages/nodes-base/nodes/Notion/Notion.node.ts @@ -212,8 +212,11 @@ export class Notion implements INodeType { async getPropertySelectValues(this: ILoadOptionsFunctions): Promise { const [name, type] = (this.getCurrentNodeParameter('&key') as string).split('|'); const databaseId = this.getCurrentNodeParameter('databaseId') as string; + const resource = this.getCurrentNodeParameter('resource') as string; + const operation = this.getCurrentNodeParameter('operation') as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); - return (properties[name][type].options).map((option: IDataObject) => ({ name: option.name, value: option.id })); + const useNames = (resource === 'databasePage' && operation === 'getAll'); + return (properties[name][type].options).map((option: IDataObject) => ({ name: option.name, value: (['select', 'multi_select'].includes(type) && useNames) ? option.name : option.id })); }, async getUsers(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = [];