Data Providers
...
MS Graph
Graph Calendar
Create Event Item
6min
Creates a new calendar event item in a user's specified calendar using the Microsoft Graph POST REST function. A default jig uses a form component to capture the event details.
Resource links:
Required OAuth scope (least to most privilege):
Calendars.ReadWrite
Create event
index
1name: ms-graph-demonstrator
2title: MS Graph Demonstrator
3description: A sample solution that uses the Microsoft Graph API. You can deploy and use this solution without any additional configuration.
4category: business
5widgets:
6 - size: 2x2 # choose size of the widget on the home hub
7 jigId: view-user-jigx
8 - size: "2x2"
9 jigId: calendar-summary
10
11onFocus:
12 type: action.action-list
13 options:
14 isSequential: true
15 actions:
16 - type: action.sync-entities
17 options:
18 provider: DATA_PROVIDER_REST
19 entities:
20 - entity: user-profile
21 function: get-user-profile
22 functionParameters:
23 accessToken: microsoft.OAuth
24 - entity: profile-picture
25 function: get-profile-picture
26 functionParameters:
27 accessToken: microsoft.OAuth
28 userId: [email protected]
29 - entity: next-week-calendar-events
30 function: get-calendar-events-next-week
31 functionParameters:
32 accessToken: microsoft.OAuth
33 startdatetime: =$fromMillis($millis())
34 enddatetime: =$fromMillis($millis()+604800000)
35 - entity: calendars
36 function: get-calendar-list
37 functionParameters:
38 accessToken: microsoft.OAuth
39
40onRefresh:
41 type: action.action-list
42 options:
43 isSequential: true
44 actions:
45 - type: action.sync-entities
46 options:
47 provider: DATA_PROVIDER_REST
48 entities:
49 - entity: user-profile
50 function: get-user-profile
51 functionParameters:
52 accessToken: microsoft.OAuth
53 - entity: profile-picture
54 function: get-profile-picture
55 functionParameters:
56 accessToken: microsoft.OAuth
57 userId: [email protected]
58
59 - entity: next-week-calendar-events
60 function: get-calendar-events-next-week
61 functionParameters:
62 accessToken: microsoft.OAuth
63 startdatetime: =$fromMillis($millis())
64 enddatetime: =$fromMillis($millis()+604800000)
65 - entity: calendars
66 function: get-calendar-list
67 functionParameters:
68 accessToken: microsoft.OAuth
69
MS Graph Create Event function in GitHub.
create-calendar-event
1provider: DATA_PROVIDER_REST
2method: POST
3url: https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events
4inputTransform: |
5 $.{
6 "subject": subject,
7 "body": {
8 "contentType": "HTML",
9 "content": description
10 },
11 "start": {
12 "dateTime": startDateTime,
13 "timeZone": startDateTimeTimeZone
14 },
15 "end": {
16 "dateTime": endDateTime,
17 "timeZone": endDateTimeTimeZone
18 },
19 "location":{
20 "displayName": location
21 }
22 }
23useLocalCall: true
24parameters:
25 accessToken:
26 location: header
27 required: true
28 type: string
29 value: microsoft.OAuth #Use manage.jigx.com to define credentials for your solution
30 calendarId:
31 type: string
32 location: path
33 required: true
34 subject:
35 type: string
36 location: body
37 required: true
38 description:
39 type: string
40 location: body
41 required: true
42 startDateTime:
43 type: string
44 location: body
45 required: true
46 startDateTimeTimeZone:
47 type: string
48 location: body
49 required: true
50 endDateTime:
51 type: string
52 location: body
53 required: true
54 endDateTimeTimeZone:
55 type: string
56 location: body
57 required: true
58 location:
59 type: string
60 location: body
61 required: true
62
MS Graph Create Calendar Events in GitHub .
create-calendar-event.jigx
1title: Create new calendar event
2description: Create a new calendar event in the selected calendar.
3type: jig.default
4icon: calendar
5
6header:
7 type: component.jig-header
8 options:
9 height: small
10 children:
11 type: component.image
12 options:
13 source:
14 uri: https://support.content.office.net/en-us/media/f1c4b693-4670-4e7a-8102-bbf1749e83fe.jpg
15
16onRefresh:
17 type: action.sync-entities
18 options:
19 provider: DATA_PROVIDER_REST
20 entities:
21 - entity: calendars
22 function: get-calendar-list
23 functionParameters:
24 accessToken: microsoft.OAuth
25 userId: [email protected]
26
27datasources:
28 availableCalendars:
29 type: datasource.sqlite
30 options:
31 provider: DATA_PROVIDER_LOCAL
32 entities:
33 - entity: calendars
34 query: |
35 SELECT id,
36 '$.id' as calId,
37 '$.name',
38 '$.color',
39 '$.hexColor',
40 '$.isDefaultCalendar',
41 '$.canShare',
42 '$.canViewPrivateItems',
43 '$.canEdit',
44 '$.allowedOnlineMeetingProviders',
45 '$.defaultOnlineMeetingProvider',
46 '$.isRemovable',
47 '$.owner'
48 FROM [calendars]
49 WHERE '$.canEdit' = true
50
51children:
52 - type: component.form
53 instanceId: newEeventForm
54 options:
55 isDiscardChangesAlertEnabled: false
56 children:
57 - type: component.dropdown
58 instanceId: calendarId
59 options:
60 label: Calendar
61 data: [email protected]
62 item:
63 type: component.dropdown-item
64 options:
65 title: [email protected]
66 value: [email protected]
67 isRequired: true
68 - type: component.text-field
69 instanceId: subject
70 options:
71 label: Subject
72 - type: component.text-field
73 instanceId: description
74 options:
75 label: Description
76 isMultiline: true
77 textArea: medium
78 - type: component.text-field
79 instanceId: location
80 options:
81 label: Location
82 - type: component.date-picker
83 instanceId: startDateTime
84 options:
85 label: Start
86 mode: datetime
87 format: LLL
88 - type: component.date-picker
89 instanceId: endDateTime
90 options:
91 label: End
92 mode: datetime
93 format: LLL
94actions:
95 - children:
96 - type: action.execute-entity
97 options:
98 title: Create Event
99 provider: DATA_PROVIDER_REST
100 function: create-calendar-event
101 entity: calendarEvents
102 method: functionCall
103 functionParameters:
104 accessToken: microsoft.OAuth
105 userId: [email protected]
106 calendarId: [email protected]
107 subject: [email protected]
108 description: [email protected]
109 startDateTime: [email protected]
110 startDateTimeTimeZone: [email protected]
111 endDateTime: [email protected]
112 endDateTimeTimeZone: [email protected]
113 location: [email protected]
114 onSuccess:
115 description: "Event Created"
116 title: "Event Created"
Updated 03 May 2024
Did this page help you?