feat(Microsoft Outlook Node): Add location and attendees fields to calendar events (#29844)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
This commit is contained in:
Dawid Myslak 2026-05-11 14:29:49 +02:00 committed by GitHub
parent 7635131bd3
commit 2e21c5fcf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 272 additions and 173 deletions

View File

@ -6,6 +6,12 @@ describe('Test MicrosoftOutlookV2, contact => event', () => {
.post(
'/calendars/AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA=/events',
{
attendees: [
{
emailAddress: { address: 'samantha@contoso.com', name: 'Samantha Booth' },
type: 'required',
},
],
body: { content: 'event description', contentType: 'html' },
bodyPreview: 'preview',
categories: ['Yellow category', 'Orange category'],
@ -16,6 +22,7 @@ describe('Test MicrosoftOutlookV2, contact => event', () => {
isCancelled: false,
isDraft: false,
isOnlineMeeting: true,
location: { displayName: "Harry's Bar" },
sensitivity: 'personal',
showAs: 'busy',
start: { dateTime: '2023-09-05T07:26:47.000Z', timeZone: 'UTC' },

View File

@ -1,170 +1,168 @@
{
"name": "My workflow 21",
"nodes": [
{
"parameters": {},
"id": "e524f588-b6a3-4849-8777-b32a8a755ae5",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
820,
360
]
},
{
"parameters": {
"resource": "event",
"operation": "create",
"calendarId": {
"__rl": true,
"value": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA=",
"mode": "list",
"cachedResultName": "Calendar"
},
"subject": "New Event",
"startDateTime": "2023-09-05T07:26:47.000Z",
"endDateTime": "2023-09-06T07:56:47.000Z",
"additionalFields": {
"categories": [
"Yellow category",
"Orange category"
],
"body": "event description",
"bodyPreview": "preview",
"hideAttendees": true,
"importance": "normal",
"isAllDay": false,
"isCancelled": false,
"isDraft": false,
"isOnlineMeeting": true,
"sensitivity": "personal",
"showAs": "busy",
"type": "occurrence"
}
},
"id": "baff6798-0304-4255-bdb0-dd3f2659373b",
"name": "Microsoft Outlook",
"type": "n8n-nodes-base.microsoftOutlook",
"typeVersion": 2,
"position": [
1040,
360
],
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "iXJCki7i5Vz0bdks",
"name": "Microsoft Outlook account 2"
}
}
}
],
"pinData": {
"Microsoft Outlook": [
{
"json": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('b834447b-6848-4af9-8390-d2259ce46b74')/calendars('AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA%3D')/events/$entity",
"@odata.etag": "W/\"WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==\"",
"id": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAENAABZf4De-LkrSqpPI8eyjUmAAAFXBFUSAAA=",
"createdDateTime": "2023-09-04T10:12:47.1985121Z",
"lastModifiedDateTime": "2023-09-04T10:12:48.2173253Z",
"changeKey": "WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==",
"categories": [
"Yellow category",
"Orange category"
],
"transactionId": null,
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"iCalUId": "040000008200E00074C5B7101A82E0080000000062DD545A18DFD90100000000000000001000000004C50947C7B42140B29018ABAB42C965",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "New Event",
"bodyPreview": "event description\r\n________________________________________________________________________________\r\nMicrosoft Teams meeting\r\nJoin on your computer, mobile app or room device\r\nClick here to join the meeting\r\nMeeting ID: 355 132 640 047\r\nPasscode: xgUo7v",
"importance": "normal",
"sensitivity": "personal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De%2FLkrSqpPI8eyjUmAAAAAAAENAABZf4De%2FLkrSqpPI8eyjUmAAAFXBFUSAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": null,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness",
"allowNewTimeProposals": true,
"occurrenceId": null,
"isDraft": false,
"hideAttendees": true,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body>\r\nevent description<br>\r\n<div style=\"width:100%\"><span style=\"white-space:nowrap; color:#5F5F5F; opacity:.36\">________________________________________________________________________________</span>\r\n</div>\r\n<div class=\"me-email-text\" lang=\"en-US\" style=\"color:#252424; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\n<div style=\"margin-top:24px; margin-bottom:20px\"><span style=\"font-size:24px; color:#252424\">Microsoft Teams meeting</span>\r\n</div>\r\n<div style=\"margin-bottom:20px\">\r\n<div style=\"margin-top:0px; margin-bottom:0px; font-weight:bold\"><span style=\"font-size:14px; color:#252424\">Join on your computer, mobile app or room device</span>\r\n</div>\r\n<a href=\"https://teams.microsoft.com/l/meetup-join/19%3ameeting_MDZmMzZmYzYtMDc4Yi00NTA2LWE3MTMtZDc5ZDI1M2JmY2M3%40thread.v2/0?context=%7b%22Tid%22%3a%2223786ca6-7ff2-4672-87d0-5c649ee0a337%22%2c%22Oid%22%3a%22b834447b-6848-4af9-8390-d2259ce46b74%22%7d\" class=\"me-email-headline\" style=\"font-size:14px; font-family:'Segoe UI Semibold','Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; text-decoration:underline; color:#6264a7\">Click\r\n here to join the meeting</a> </div>\r\n<div style=\"margin-bottom:20px; margin-top:20px\">\r\n<div style=\"margin-bottom:4px\"><span data-tid=\"meeting-code\" style=\"font-size:14px; color:#252424\">Meeting ID:\r\n<span style=\"font-size:16px; color:#252424\">355 132 640 047</span> </span><br>\r\n<span style=\"font-size:14px; color:#252424\">Passcode: </span><span style=\"font-size:16px; color:#252424\">xgUo7v\r\n</span>\r\n<div style=\"font-size:14px\"><a href=\"https://www.microsoft.com/en-us/microsoft-teams/download-app\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">Download\r\n Teams</a> | <a href=\"https://www.microsoft.com/microsoft-teams/join-a-meeting\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\nJoin on the web</a></div>\r\n</div>\r\n</div>\r\n<div style=\"margin-bottom:24px; margin-top:20px\"><a href=\"https://aka.ms/JoinTeamsMeeting\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">Learn More</a>\r\n | <a href=\"https://teams.microsoft.com/meetingOptions/?organizerId=b834447b-6848-4af9-8390-d2259ce46b74&amp;tenantId=23786ca6-7ff2-4672-87d0-5c649ee0a337&amp;threadId=19_meeting_MDZmMzZmYzYtMDc4Yi00NTA2LWE3MTMtZDc5ZDI1M2JmY2M3@thread.v2&amp;messageId=0&amp;language=en-US\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\nMeeting options</a> </div>\r\n</div>\r\n<div style=\"font-size:14px; margin-bottom:4px; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\n</div>\r\n<div style=\"font-size:12px\"></div>\r\n<div></div>\r\n<div style=\"width:100%\"><span style=\"white-space:nowrap; color:#5F5F5F; opacity:.36\">________________________________________________________________________________</span>\r\n</div>\r\n</body>\r\n</html>\r\n"
},
"start": {
"dateTime": "2023-09-05T07:26:47.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2023-09-06T07:56:47.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Microsoft Teams Meeting",
"locationType": "default",
"uniqueId": "Microsoft Teams Meeting",
"uniqueIdType": "private"
},
"locations": [
{
"displayName": "Microsoft Teams Meeting",
"locationType": "default",
"uniqueId": "Microsoft Teams Meeting",
"uniqueIdType": "private"
}
],
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "Michael Kret",
"address": "MichaelDevSandbox@5w1hb7.onmicrosoft.com"
}
},
"onlineMeeting": {
"joinUrl": "https://teams.microsoft.com/l/meetup-join/19%3ameeting_MDZmMzZmYzYtMDc4Yi00NTA2LWE3MTMtZDc5ZDI1M2JmY2M3%40thread.v2/0?context=%7b%22Tid%22%3a%2223786ca6-7ff2-4672-87d0-5c649ee0a337%22%2c%22Oid%22%3a%22b834447b-6848-4af9-8390-d2259ce46b74%22%7d"
}
}
}
]
},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Microsoft Outlook",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "dceb08aa-5897-44d1-afbc-748d1e8a2626",
"id": "1CYHzBXQw1nfPGtB",
"meta": {
"instanceId": "b888bd11cd1ddbb95450babf3e199556799d999b896f650de768b8370ee50363"
},
"tags": []
"name": "My workflow 21",
"nodes": [
{
"parameters": {},
"id": "e524f588-b6a3-4849-8777-b32a8a755ae5",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [820, 360]
},
{
"parameters": {
"resource": "event",
"operation": "create",
"calendarId": {
"__rl": true,
"value": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA=",
"mode": "list",
"cachedResultName": "Calendar"
},
"subject": "New Event",
"startDateTime": "2023-09-05T07:26:47.000Z",
"endDateTime": "2023-09-06T07:56:47.000Z",
"additionalFields": {
"attendees": {
"values": [
{
"email": "samantha@contoso.com",
"name": "Samantha Booth",
"type": "required"
}
]
},
"categories": ["Yellow category", "Orange category"],
"body": "event description",
"bodyPreview": "preview",
"hideAttendees": true,
"importance": "normal",
"isAllDay": false,
"isCancelled": false,
"isDraft": false,
"isOnlineMeeting": true,
"location": "Harry's Bar",
"sensitivity": "personal",
"showAs": "busy",
"type": "occurrence"
}
},
"id": "baff6798-0304-4255-bdb0-dd3f2659373b",
"name": "Microsoft Outlook",
"type": "n8n-nodes-base.microsoftOutlook",
"typeVersion": 2,
"position": [1040, 360],
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "iXJCki7i5Vz0bdks",
"name": "Microsoft Outlook account 2"
}
}
}
],
"pinData": {
"Microsoft Outlook": [
{
"json": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('b834447b-6848-4af9-8390-d2259ce46b74')/calendars('AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA%3D')/events/$entity",
"@odata.etag": "W/\"WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==\"",
"id": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAENAABZf4De-LkrSqpPI8eyjUmAAAFXBFUSAAA=",
"createdDateTime": "2023-09-04T10:12:47.1985121Z",
"lastModifiedDateTime": "2023-09-04T10:12:48.2173253Z",
"changeKey": "WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==",
"categories": ["Yellow category", "Orange category"],
"transactionId": null,
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"iCalUId": "040000008200E00074C5B7101A82E0080000000062DD545A18DFD90100000000000000001000000004C50947C7B42140B29018ABAB42C965",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "New Event",
"bodyPreview": "event description\r\n________________________________________________________________________________\r\nMicrosoft Teams meeting\r\nJoin on your computer, mobile app or room device\r\nClick here to join the meeting\r\nMeeting ID: 355 132 640 047\r\nPasscode: xgUo7v",
"importance": "normal",
"sensitivity": "personal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De%2FLkrSqpPI8eyjUmAAAAAAAENAABZf4De%2FLkrSqpPI8eyjUmAAAFXBFUSAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": null,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness",
"allowNewTimeProposals": true,
"occurrenceId": null,
"isDraft": false,
"hideAttendees": true,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body>\r\nevent description<br>\r\n<div style=\"width:100%\"><span style=\"white-space:nowrap; color:#5F5F5F; opacity:.36\">________________________________________________________________________________</span>\r\n</div>\r\n<div class=\"me-email-text\" lang=\"en-US\" style=\"color:#252424; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\n<div style=\"margin-top:24px; margin-bottom:20px\"><span style=\"font-size:24px; color:#252424\">Microsoft Teams meeting</span>\r\n</div>\r\n<div style=\"margin-bottom:20px\">\r\n<div style=\"margin-top:0px; margin-bottom:0px; font-weight:bold\"><span style=\"font-size:14px; color:#252424\">Join on your computer, mobile app or room device</span>\r\n</div>\r\n<a href=\"https://teams.microsoft.com/l/meetup-join/19%3ameeting_MDZmMzZmYzYtMDc4Yi00NTA2LWE3MTMtZDc5ZDI1M2JmY2M3%40thread.v2/0?context=%7b%22Tid%22%3a%2223786ca6-7ff2-4672-87d0-5c649ee0a337%22%2c%22Oid%22%3a%22b834447b-6848-4af9-8390-d2259ce46b74%22%7d\" class=\"me-email-headline\" style=\"font-size:14px; font-family:'Segoe UI Semibold','Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; text-decoration:underline; color:#6264a7\">Click\r\n here to join the meeting</a> </div>\r\n<div style=\"margin-bottom:20px; margin-top:20px\">\r\n<div style=\"margin-bottom:4px\"><span data-tid=\"meeting-code\" style=\"font-size:14px; color:#252424\">Meeting ID:\r\n<span style=\"font-size:16px; color:#252424\">355 132 640 047</span> </span><br>\r\n<span style=\"font-size:14px; color:#252424\">Passcode: </span><span style=\"font-size:16px; color:#252424\">xgUo7v\r\n</span>\r\n<div style=\"font-size:14px\"><a href=\"https://www.microsoft.com/en-us/microsoft-teams/download-app\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">Download\r\n Teams</a> | <a href=\"https://www.microsoft.com/microsoft-teams/join-a-meeting\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\nJoin on the web</a></div>\r\n</div>\r\n</div>\r\n<div style=\"margin-bottom:24px; margin-top:20px\"><a href=\"https://aka.ms/JoinTeamsMeeting\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">Learn More</a>\r\n | <a href=\"https://teams.microsoft.com/meetingOptions/?organizerId=b834447b-6848-4af9-8390-d2259ce46b74&amp;tenantId=23786ca6-7ff2-4672-87d0-5c649ee0a337&amp;threadId=19_meeting_MDZmMzZmYzYtMDc4Yi00NTA2LWE3MTMtZDc5ZDI1M2JmY2M3@thread.v2&amp;messageId=0&amp;language=en-US\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\nMeeting options</a> </div>\r\n</div>\r\n<div style=\"font-size:14px; margin-bottom:4px; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\n</div>\r\n<div style=\"font-size:12px\"></div>\r\n<div></div>\r\n<div style=\"width:100%\"><span style=\"white-space:nowrap; color:#5F5F5F; opacity:.36\">________________________________________________________________________________</span>\r\n</div>\r\n</body>\r\n</html>\r\n"
},
"start": {
"dateTime": "2023-09-05T07:26:47.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2023-09-06T07:56:47.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Microsoft Teams Meeting",
"locationType": "default",
"uniqueId": "Microsoft Teams Meeting",
"uniqueIdType": "private"
},
"locations": [
{
"displayName": "Microsoft Teams Meeting",
"locationType": "default",
"uniqueId": "Microsoft Teams Meeting",
"uniqueIdType": "private"
}
],
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "Michael Kret",
"address": "MichaelDevSandbox@5w1hb7.onmicrosoft.com"
}
},
"onlineMeeting": {
"joinUrl": "https://teams.microsoft.com/l/meetup-join/19%3ameeting_MDZmMzZmYzYtMDc4Yi00NTA2LWE3MTMtZDc5ZDI1M2JmY2M3%40thread.v2/0?context=%7b%22Tid%22%3a%2223786ca6-7ff2-4672-87d0-5c649ee0a337%22%2c%22Oid%22%3a%22b834447b-6848-4af9-8390-d2259ce46b74%22%7d"
}
}
}
]
},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Microsoft Outlook",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "dceb08aa-5897-44d1-afbc-748d1e8a2626",
"id": "1CYHzBXQw1nfPGtB",
"meta": {
"instanceId": "b888bd11cd1ddbb95450babf3e199556799d999b896f650de768b8370ee50363"
},
"tags": []
}

View File

@ -5,7 +5,8 @@ import { NodeOperationError } from 'n8n-workflow';
import { updateDisplayOptions } from '@utils/utilities';
import { calendarRLC } from '../../descriptions';
import { calendarRLC, eventAttendeesField, eventLocationField } from '../../descriptions';
import { prepareEventFields } from '../../helpers/utils';
import { microsoftApiRequest } from '../../transport';
export const properties: INodeProperties[] = [
@ -38,6 +39,7 @@ export const properties: INodeProperties[] = [
placeholder: 'Add Field',
default: {},
options: [
eventAttendeesField,
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options
displayName: 'Categories',
@ -117,6 +119,7 @@ export const properties: INodeProperties[] = [
type: 'boolean',
default: false,
},
eventLocationField,
{
displayName: 'Sensitivity',
name: 'sensitivity',
@ -251,6 +254,8 @@ export async function execute(this: IExecuteFunctions, index: number) {
};
}
additionalFields = prepareEventFields(additionalFields);
let startDateTime = this.getNodeParameter('startDateTime', index) as string;
let endDateTime = this.getNodeParameter('endDateTime', index) as string;

View File

@ -3,8 +3,8 @@ import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workfl
import { updateDisplayOptions } from '@utils/utilities';
import { calendarRLC, eventRLC } from '../../descriptions';
import { decodeOutlookId } from '../../helpers/utils';
import { calendarRLC, eventAttendeesField, eventLocationField, eventRLC } from '../../descriptions';
import { decodeOutlookId, prepareEventFields } from '../../helpers/utils';
import { microsoftApiRequest } from '../../transport';
export const properties: INodeProperties[] = [
@ -17,6 +17,10 @@ export const properties: INodeProperties[] = [
placeholder: 'Add Field',
default: {},
options: [
{
...eventAttendeesField,
description: 'Setting attendees on update replaces the entire attendee list',
},
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options
displayName: 'Categories',
@ -102,6 +106,7 @@ export const properties: INodeProperties[] = [
type: 'boolean',
default: true,
},
eventLocationField,
{
displayName: 'Sensitivity',
name: 'sensitivity',
@ -210,7 +215,7 @@ const displayOptions = {
export const description = updateDisplayOptions(displayOptions, properties);
export async function execute(this: IExecuteFunctions, index: number) {
const additionalFields = this.getNodeParameter('additionalFields', index);
let additionalFields = this.getNodeParameter('additionalFields', index);
const eventId = decodeOutlookId(
this.getNodeParameter('eventId', index, undefined, {
@ -232,6 +237,8 @@ export async function execute(this: IExecuteFunctions, index: number) {
};
}
additionalFields = prepareEventFields(additionalFields);
let startDateTime = additionalFields.start as string;
let endDateTime = additionalFields.end as string;

View File

@ -1,4 +1,65 @@
import type { INodeProperties } from 'n8n-workflow';
import type { INodeProperties, INodePropertyCollection } from 'n8n-workflow';
const attendeeValues: INodePropertyCollection = {
displayName: 'Attendee',
name: 'values',
values: [
{
displayName: 'Email',
name: 'email',
type: 'string',
placeholder: 'name@email.com',
required: true,
default: '',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Type',
name: 'type',
type: 'options',
default: 'required',
options: [
{
name: 'Optional',
value: 'optional',
},
{
name: 'Required',
value: 'required',
},
{
name: 'Resource',
value: 'resource',
},
],
},
],
};
export const eventAttendeesField: INodeProperties = {
displayName: 'Attendees',
name: 'attendees',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
placeholder: 'Add Attendee',
options: [attendeeValues],
};
export const eventLocationField: INodeProperties = {
displayName: 'Location',
name: 'location',
type: 'string',
default: '',
description: 'The location of the event (e.g. a meeting room name, address, or meeting link)',
};
export const returnAllOrLimit: INodeProperties[] = [
{

View File

@ -229,6 +229,27 @@ export function prepareContactFields(fields: IDataObject) {
return returnData;
}
export function prepareEventFields(fields: IDataObject): IDataObject {
const result = { ...fields };
if (result.location) {
result.location = { displayName: result.location };
}
if (result.attendees) {
const attendeeEntries = ((result.attendees as IDataObject).values as IDataObject[]) ?? [];
result.attendees = attendeeEntries.map((entry) => ({
emailAddress: {
address: entry.email,
...(entry.name ? { name: entry.name } : {}),
},
type: entry.type,
}));
}
return result;
}
export function prepareFilterString(filters: IDataObject) {
const selectedFilters = filters.filters as IDataObject;
const filterString: string[] = [];