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
name: ms-graph-demonstrator
title: MS Graph Demonstrator
description: A sample solution that uses the Microsoft Graph API. You can deploy and use this solution without any additional configuration.
category: business
widgets:
- size: 2x2 # choose size of the widget on the home hub
jigId: view-user-jigx
- size: "2x2"
jigId: calendar-summary
onFocus:
type: action.action-list
options:
isSequential: true
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: user-profile
function: get-user-profile
functionParameters:
accessToken: microsoft.OAuth
- entity: profile-picture
function: get-profile-picture
functionParameters:
accessToken: microsoft.OAuth
userId: [email protected]
- entity: next-week-calendar-events
function: get-calendar-events-next-week
functionParameters:
accessToken: microsoft.OAuth
startdatetime: =$fromMillis($millis())
enddatetime: =$fromMillis($millis()+604800000)
- entity: calendars
function: get-calendar-list
functionParameters:
accessToken: microsoft.OAuth
onRefresh:
type: action.action-list
options:
isSequential: true
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: user-profile
function: get-user-profile
functionParameters:
accessToken: microsoft.OAuth
- entity: profile-picture
function: get-profile-picture
functionParameters:
accessToken: microsoft.OAuth
userId: [email protected]
- entity: next-week-calendar-events
function: get-calendar-events-next-week
functionParameters:
accessToken: microsoft.OAuth
startdatetime: =$fromMillis($millis())
enddatetime: =$fromMillis($millis()+604800000)
- entity: calendars
function: get-calendar-list
functionParameters:
accessToken: microsoft.OAuth
MS Graph Create Event function in GitHub.
create-calendar-event
provider: DATA_PROVIDER_REST
method: POST
url: https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events
inputTransform: |
$.{
"subject": subject,
"body": {
"contentType": "HTML",
"content": description
},
"start": {
"dateTime": startDateTime,
"timeZone": startDateTimeTimeZone
},
"end": {
"dateTime": endDateTime,
"timeZone": endDateTimeTimeZone
},
"location":{
"displayName": location
}
}
useLocalCall: true
parameters:
accessToken:
location: header
required: true
type: string
value: microsoft.OAuth #Use manage.jigx.com to define credentials for your solution
calendarId:
type: string
location: path
required: true
subject:
type: string
location: body
required: true
description:
type: string
location: body
required: true
startDateTime:
type: string
location: body
required: true
startDateTimeTimeZone:
type: string
location: body
required: true
endDateTime:
type: string
location: body
required: true
endDateTimeTimeZone:
type: string
location: body
required: true
location:
type: string
location: body
required: true
MS Graph Create Calendar Events in GitHub .
create-calendar-event.jigx
title: Create new calendar event
description: Create a new calendar event in the selected calendar.
type: jig.default
icon: calendar
header:
type: component.jig-header
options:
height: small
children:
type: component.image
options:
source:
uri: https://support.content.office.net/en-us/media/f1c4b693-4670-4e7a-8102-bbf1749e83fe.jpg
onRefresh:
type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: calendars
function: get-calendar-list
functionParameters:
accessToken: microsoft.OAuth
userId: [email protected]
datasources:
availableCalendars:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: calendars
query: |
SELECT id,
'$.id' as calId,
'$.name',
'$.color',
'$.hexColor',
'$.isDefaultCalendar',
'$.canShare',
'$.canViewPrivateItems',
'$.canEdit',
'$.allowedOnlineMeetingProviders',
'$.defaultOnlineMeetingProvider',
'$.isRemovable',
'$.owner'
FROM [calendars]
WHERE '$.canEdit' = true
children:
- type: component.form
instanceId: newEeventForm
options:
isDiscardChangesAlertEnabled: false
children:
- type: component.dropdown
instanceId: calendarId
options:
label: Calendar
data: [email protected]
item:
type: component.dropdown-item
options:
title: [email protected]
value: [email protected]
isRequired: true
- type: component.text-field
instanceId: subject
options:
label: Subject
- type: component.text-field
instanceId: description
options:
label: Description
isMultiline: true
textArea: medium
- type: component.text-field
instanceId: location
options:
label: Location
- type: component.date-picker
instanceId: startDateTime
options:
label: Start
mode: datetime
format: LLL
- type: component.date-picker
instanceId: endDateTime
options:
label: End
mode: datetime
format: LLL
actions:
- children:
- type: action.execute-entity
options:
title: Create Event
provider: DATA_PROVIDER_REST
function: create-calendar-event
entity: calendarEvents
method: functionCall
functionParameters:
accessToken: microsoft.OAuth
userId: [email protected]
calendarId: [email protected]
subject: [email protected]
description: [email protected]
startDateTime: [email protected]
startDateTimeTimeZone: [email protected]
endDateTime: [email protected]
endDateTimeTimeZone: [email protected]
location: [email protected]
onSuccess:
description: "Event Created"
title: "Event Created"
Updated 03 May 2024
Did this page help you?