Data Providers
...
MS Graph
Graph Calendar
Get Event List
6min
Get a list of the next week's events on a user's calendar from Microsoft Graph using GET REST functions and show the events in a calendar .
Resource links:
Required OAuth scope (least to most privilege):
Calendars.Read Calendars.ReadWrite
Related Sample
This example uses Get Calendar List to provide the calendar input to the view-calendar-events and navigates to Get Event Item when the event item is pressed.
Calendar events
index.jigx
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"
7 jigId: calendar-summary
8 - size: "4x2"
9 jigId: next-meeting
10 when: |
11 [email protected]=null? false:true
12
13onFocus:
14 type: action.action-list
15 options:
16 isSequential: true
17 actions:
18 - type: action.sync-entities
19 options:
20 provider: DATA_PROVIDER_REST
21 entities:
22 - entity: next-week-calendar-events
23 function: get-calendar-events-next-week
24 functionParameters:
25 accessToken: microsoft.OAuth
26 startdatetime: =$fromMillis($millis())
27 enddatetime: =$fromMillis($millis()+604800000)
28 - entity: calendars
29 function: get-calendar-list
30 functionParameters:
31 accessToken: microsoft.OAuth
32
MS Graph Event List function in GitHub.
get-calendar-event-list.jigx
get-calendar-events-next-week.jigx
1provider: DATA_PROVIDER_REST
2method: GET
3url: https://graph.microsoft.com/v1.0/me/calendarview
4outputTransform: $
5useLocalCall: true
6parameters:
7 accessToken:
8 location: header
9 required: true
10 type: string
11 value: microsoft.OAuth #Use manage.jigx.com to define credentials for your solution
12 startdatetime:
13 type: string
14 location: query
15 required: true
16 enddatetime:
17 type: string
18 location: query
19 required: true
20 $top:
21 type: string
22 location: query
23 required: false
24 value: 100
25records: =$.value
26continuation:
27 when: =$."@odata.nextLink"
28 url: =$."@odata.nextLink"
29 parameters:
30 accessToken:
31 location: header
32 required: true
33 type: string
34 value: microsoft.OAuth
35
MS Graph Calendar Events List in GitHub.
view-calendar-events.jigx
1title: Calendar
2type: jig.calendar
3
4header:
5 type: component.jig-header
6 options:
7 height: small
8 children:
9 type: component.image
10 options:
11 source:
12 uri: https://support.content.office.net/en-us/media/f1c4b693-4670-4e7a-8102-bbf1749e83fe.jpg
13
14# sync the events for the selected calendar by calendarId
15onFocus:
16 type: action.sync-entities
17 options:
18 provider: DATA_PROVIDER_REST
19 entities:
20 - entity: calendarEvents
21 function: get-calendar-event-list
22 functionParameters:
23 accessToken: microsoft.OAuth
24 calendarId: [email protected]
25 $filter: ="start/dateTime ge '" & $fromMillis($millis()-86400000) & "' and end/dateTime le '" & $fromMillis($millis()+5184000000) & "'"
26
27onRefresh:
28 type: action.sync-entities
29 options:
30 provider: DATA_PROVIDER_REST
31 entities:
32 - entity: calendarEvents
33 function: get-calendar-event-list
34 functionParameters:
35 accessToken: microsoft.OAuth
36 calendarId: [email protected]
37 $filter: ="start/dateTime ge '" & $fromMillis($millis()-86400000) & "' and end/dateTime le '" & $fromMillis($millis()+5184000000) & "'"
38
39datasources:
40 calendarEvents:
41 type: datasource.sqlite
42 options:
43 provider: DATA_PROVIDER_LOCAL
44 entities:
45 - entity: calendarEvents
46 jsonProperties:
47 - attendees
48 query: |
49 SELECT id,
50 '$.id' as eventId,
51 '$.createdDateTime',
52 '$.lastModifiedDateTime',
53 '$.originalStartTimeZone',
54 '$.originalEndTimeZone',
55 '$.reminderMinutesBeforeStart',
56 '$.isReminderOn',
57 '$.hasAttachments',
58 '$.subject',
59 '$.bodyPreview',
60 '$.importance',
61 '$.sensitivity',
62 '$.isCancelled',
63 '$.isOrganizer',
64 '$.showAs',
65 '$.webLink',
66 json_extract(Data, '$.onlineMeetingUrl.joinUrl') as onlineMeetingUrl,
67 '$.isOnlineMeeting',
68 '$.onlineMeetingProvider',
69 '$.onlineMeeting',
70 json_extract(Data, '$.body.contentType') as bodyContentType,
71 json_extract(Data, '$.body.content') as bodyContent,
72 json_extract(Data, '$.start.dateTime') || 'Z' as startTime,
73 json_extract(Data, '$.end.dateTime') || 'Z' as endTime,
74 '$.location',
75 '$.attendees',
76 '$.organizer'
77 FROM [calendarEvents]
78
79data: [email protected]
80item:
81 type: component.event
82 options:
83 from: [email protected]
84 to: [email protected]
85 title: [email protected]
86 location: "='Importance: ' & @ctx.current.item.importance"
87 description: [email protected]
88 people: "[email protected].{'fullName': emailAddress.address, 'email': emailAddress.address}"
89 buttonTitle: View Event Details
90 onPress:
91 type: action.go-to
92 options:
93 linkTo: view-calendar-event-details-w
94 parameters:
95 eventId: [email protected]
96 evtFrom: [email protected]
97 evtTo: [email protected]
98 bodyContent: [email protected]
99 summary: [email protected]
100 subject: [email protected]
101 onlineMeetingUrl: [email protected]
102 isOnlineMeeting: [email protected]
103 bodyPreview: [email protected]
104 attendees: [email protected]
105 onlineMeetingProvider: [email protected]
106
107actions:
108 - children:
109 - type: action.go-to
110 options:
111 title: Create New Event
112 linkTo: create-calendar-event
Updated 14 May 2024
Did this page help you?