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

View File

@ -1,170 +1,168 @@
{ {
"name": "My workflow 21", "name": "My workflow 21",
"nodes": [ "nodes": [
{ {
"parameters": {}, "parameters": {},
"id": "e524f588-b6a3-4849-8777-b32a8a755ae5", "id": "e524f588-b6a3-4849-8777-b32a8a755ae5",
"name": "When clicking \"Execute Workflow\"", "name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger", "type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [820, 360]
820, },
360 {
] "parameters": {
}, "resource": "event",
{ "operation": "create",
"parameters": { "calendarId": {
"resource": "event", "__rl": true,
"operation": "create", "value": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA=",
"calendarId": { "mode": "list",
"__rl": true, "cachedResultName": "Calendar"
"value": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA=", },
"mode": "list", "subject": "New Event",
"cachedResultName": "Calendar" "startDateTime": "2023-09-05T07:26:47.000Z",
}, "endDateTime": "2023-09-06T07:56:47.000Z",
"subject": "New Event", "additionalFields": {
"startDateTime": "2023-09-05T07:26:47.000Z", "attendees": {
"endDateTime": "2023-09-06T07:56:47.000Z", "values": [
"additionalFields": { {
"categories": [ "email": "samantha@contoso.com",
"Yellow category", "name": "Samantha Booth",
"Orange category" "type": "required"
], }
"body": "event description", ]
"bodyPreview": "preview", },
"hideAttendees": true, "categories": ["Yellow category", "Orange category"],
"importance": "normal", "body": "event description",
"isAllDay": false, "bodyPreview": "preview",
"isCancelled": false, "hideAttendees": true,
"isDraft": false, "importance": "normal",
"isOnlineMeeting": true, "isAllDay": false,
"sensitivity": "personal", "isCancelled": false,
"showAs": "busy", "isDraft": false,
"type": "occurrence" "isOnlineMeeting": true,
} "location": "Harry's Bar",
}, "sensitivity": "personal",
"id": "baff6798-0304-4255-bdb0-dd3f2659373b", "showAs": "busy",
"name": "Microsoft Outlook", "type": "occurrence"
"type": "n8n-nodes-base.microsoftOutlook", }
"typeVersion": 2, },
"position": [ "id": "baff6798-0304-4255-bdb0-dd3f2659373b",
1040, "name": "Microsoft Outlook",
360 "type": "n8n-nodes-base.microsoftOutlook",
], "typeVersion": 2,
"credentials": { "position": [1040, 360],
"microsoftOutlookOAuth2Api": { "credentials": {
"id": "iXJCki7i5Vz0bdks", "microsoftOutlookOAuth2Api": {
"name": "Microsoft Outlook account 2" "id": "iXJCki7i5Vz0bdks",
} "name": "Microsoft Outlook account 2"
} }
} }
], }
"pinData": { ],
"Microsoft Outlook": [ "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", "json": {
"@odata.etag": "W/\"WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==\"", "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('b834447b-6848-4af9-8390-d2259ce46b74')/calendars('AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAEGAABZf4De-LkrSqpPI8eyjUmAAAAJ9-JDAAA%3D')/events/$entity",
"id": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAENAABZf4De-LkrSqpPI8eyjUmAAAFXBFUSAAA=", "@odata.etag": "W/\"WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==\"",
"createdDateTime": "2023-09-04T10:12:47.1985121Z", "id": "AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De-LkrSqpPI8eyjUmAAAAAAAENAABZf4De-LkrSqpPI8eyjUmAAAFXBFUSAAA=",
"lastModifiedDateTime": "2023-09-04T10:12:48.2173253Z", "createdDateTime": "2023-09-04T10:12:47.1985121Z",
"changeKey": "WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==", "lastModifiedDateTime": "2023-09-04T10:12:48.2173253Z",
"categories": [ "changeKey": "WX+A3vy5K0qqTyPHso1JgAABVtwgEQ==",
"Yellow category", "categories": ["Yellow category", "Orange category"],
"Orange category" "transactionId": null,
], "originalStartTimeZone": "UTC",
"transactionId": null, "originalEndTimeZone": "UTC",
"originalStartTimeZone": "UTC", "iCalUId": "040000008200E00074C5B7101A82E0080000000062DD545A18DFD90100000000000000001000000004C50947C7B42140B29018ABAB42C965",
"originalEndTimeZone": "UTC", "reminderMinutesBeforeStart": 15,
"iCalUId": "040000008200E00074C5B7101A82E0080000000062DD545A18DFD90100000000000000001000000004C50947C7B42140B29018ABAB42C965", "isReminderOn": true,
"reminderMinutesBeforeStart": 15, "hasAttachments": false,
"isReminderOn": true, "subject": "New Event",
"hasAttachments": false, "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",
"subject": "New Event", "importance": "normal",
"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", "sensitivity": "personal",
"importance": "normal", "isAllDay": false,
"sensitivity": "personal", "isCancelled": false,
"isAllDay": false, "isOrganizer": true,
"isCancelled": false, "responseRequested": true,
"isOrganizer": true, "seriesMasterId": null,
"responseRequested": true, "showAs": "busy",
"seriesMasterId": null, "type": "singleInstance",
"showAs": "busy", "webLink": "https://outlook.office365.com/owa/?itemid=AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De%2FLkrSqpPI8eyjUmAAAAAAAENAABZf4De%2FLkrSqpPI8eyjUmAAAFXBFUSAAA%3D&exvsurl=1&path=/calendar/item",
"type": "singleInstance", "onlineMeetingUrl": null,
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADlhOTA0MTc5LWUwOTMtNDRkZS05NzE0LTNlYmI0ZWM5OWI5OABGAAAAAABPLqzvT6b9RLP0CKzHiJrRBwBZf4De%2FLkrSqpPI8eyjUmAAAAAAAENAABZf4De%2FLkrSqpPI8eyjUmAAAFXBFUSAAA%3D&exvsurl=1&path=/calendar/item", "isOnlineMeeting": true,
"onlineMeetingUrl": null, "onlineMeetingProvider": "teamsForBusiness",
"isOnlineMeeting": true, "allowNewTimeProposals": true,
"onlineMeetingProvider": "teamsForBusiness", "occurrenceId": null,
"allowNewTimeProposals": true, "isDraft": false,
"occurrenceId": null, "hideAttendees": true,
"isDraft": false, "responseStatus": {
"hideAttendees": true, "response": "organizer",
"responseStatus": { "time": "0001-01-01T00:00:00Z"
"response": "organizer", },
"time": "0001-01-01T00:00:00Z" "body": {
}, "contentType": "html",
"body": { "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"
"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",
"start": { "timeZone": "UTC"
"dateTime": "2023-09-05T07:26:47.0000000", },
"timeZone": "UTC" "end": {
}, "dateTime": "2023-09-06T07:56:47.0000000",
"end": { "timeZone": "UTC"
"dateTime": "2023-09-06T07:56:47.0000000", },
"timeZone": "UTC" "location": {
}, "displayName": "Microsoft Teams Meeting",
"location": { "locationType": "default",
"displayName": "Microsoft Teams Meeting", "uniqueId": "Microsoft Teams Meeting",
"locationType": "default", "uniqueIdType": "private"
"uniqueId": "Microsoft Teams Meeting", },
"uniqueIdType": "private" "locations": [
}, {
"locations": [ "displayName": "Microsoft Teams Meeting",
{ "locationType": "default",
"displayName": "Microsoft Teams Meeting", "uniqueId": "Microsoft Teams Meeting",
"locationType": "default", "uniqueIdType": "private"
"uniqueId": "Microsoft Teams Meeting", }
"uniqueIdType": "private" ],
} "recurrence": null,
], "attendees": [],
"recurrence": null, "organizer": {
"attendees": [], "emailAddress": {
"organizer": { "name": "Michael Kret",
"emailAddress": { "address": "MichaelDevSandbox@5w1hb7.onmicrosoft.com"
"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"
"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\"": {
"connections": { "main": [
"When clicking \"Execute Workflow\"": { [
"main": [ {
[ "node": "Microsoft Outlook",
{ "type": "main",
"node": "Microsoft Outlook", "index": 0
"type": "main", }
"index": 0 ]
} ]
] }
] },
} "active": false,
}, "settings": {
"active": false, "executionOrder": "v1"
"settings": { },
"executionOrder": "v1" "versionId": "dceb08aa-5897-44d1-afbc-748d1e8a2626",
}, "id": "1CYHzBXQw1nfPGtB",
"versionId": "dceb08aa-5897-44d1-afbc-748d1e8a2626", "meta": {
"id": "1CYHzBXQw1nfPGtB", "instanceId": "b888bd11cd1ddbb95450babf3e199556799d999b896f650de768b8370ee50363"
"meta": { },
"instanceId": "b888bd11cd1ddbb95450babf3e199556799d999b896f650de768b8370ee50363" "tags": []
},
"tags": []
} }

View File

@ -5,7 +5,8 @@ import { NodeOperationError } from 'n8n-workflow';
import { updateDisplayOptions } from '@utils/utilities'; import { updateDisplayOptions } from '@utils/utilities';
import { calendarRLC } from '../../descriptions'; import { calendarRLC, eventAttendeesField, eventLocationField } from '../../descriptions';
import { prepareEventFields } from '../../helpers/utils';
import { microsoftApiRequest } from '../../transport'; import { microsoftApiRequest } from '../../transport';
export const properties: INodeProperties[] = [ export const properties: INodeProperties[] = [
@ -38,6 +39,7 @@ export const properties: INodeProperties[] = [
placeholder: 'Add Field', placeholder: 'Add Field',
default: {}, default: {},
options: [ options: [
eventAttendeesField,
{ {
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options // eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options
displayName: 'Categories', displayName: 'Categories',
@ -117,6 +119,7 @@ export const properties: INodeProperties[] = [
type: 'boolean', type: 'boolean',
default: false, default: false,
}, },
eventLocationField,
{ {
displayName: 'Sensitivity', displayName: 'Sensitivity',
name: '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 startDateTime = this.getNodeParameter('startDateTime', index) as string;
let endDateTime = this.getNodeParameter('endDateTime', 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 { updateDisplayOptions } from '@utils/utilities';
import { calendarRLC, eventRLC } from '../../descriptions'; import { calendarRLC, eventAttendeesField, eventLocationField, eventRLC } from '../../descriptions';
import { decodeOutlookId } from '../../helpers/utils'; import { decodeOutlookId, prepareEventFields } from '../../helpers/utils';
import { microsoftApiRequest } from '../../transport'; import { microsoftApiRequest } from '../../transport';
export const properties: INodeProperties[] = [ export const properties: INodeProperties[] = [
@ -17,6 +17,10 @@ export const properties: INodeProperties[] = [
placeholder: 'Add Field', placeholder: 'Add Field',
default: {}, default: {},
options: [ 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 // eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options
displayName: 'Categories', displayName: 'Categories',
@ -102,6 +106,7 @@ export const properties: INodeProperties[] = [
type: 'boolean', type: 'boolean',
default: true, default: true,
}, },
eventLocationField,
{ {
displayName: 'Sensitivity', displayName: 'Sensitivity',
name: 'sensitivity', name: 'sensitivity',
@ -210,7 +215,7 @@ const displayOptions = {
export const description = updateDisplayOptions(displayOptions, properties); export const description = updateDisplayOptions(displayOptions, properties);
export async function execute(this: IExecuteFunctions, index: number) { export async function execute(this: IExecuteFunctions, index: number) {
const additionalFields = this.getNodeParameter('additionalFields', index); let additionalFields = this.getNodeParameter('additionalFields', index);
const eventId = decodeOutlookId( const eventId = decodeOutlookId(
this.getNodeParameter('eventId', index, undefined, { 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 startDateTime = additionalFields.start as string;
let endDateTime = additionalFields.end 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[] = [ export const returnAllOrLimit: INodeProperties[] = [
{ {

View File

@ -229,6 +229,27 @@ export function prepareContactFields(fields: IDataObject) {
return returnData; 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) { export function prepareFilterString(filters: IDataObject) {
const selectedFilters = filters.filters as IDataObject; const selectedFilters = filters.filters as IDataObject;
const filterString: string[] = []; const filterString: string[] = [];