Get Event Item

Required OAuth scope (least to most privilege):

Calendars.Read Calendars.ReadWrite

Related Sample

This example uses Get Calendar List and Get Event List to provide the calendar id and event id input to the view-calendar-event-details jig.

Event items
Event items

Examples and code snippets

General

name: ms-graph-demonstrator
title: MS Graph Demonstrator
description: A solution using Microsoft Graph APIs .
category: business

onLoad:
  type: action.execute-action
  options:
    action: full-sync

onRefresh:
  type: action.execute-action
  options:
    action: full-sync

expressions:
  today: =$substring($now(), 0, 10)
  todayStart: =$toMillis($today)
  weekdayStr: =$floor($todayStart/86400000)
  weekdayNum: =($weekdayStr + 4) % 7
  startOfWeek: =$todayStart - ($weekdayNum * 86400000)
  thisWeek: =$startOfWeek + 604800000
  next7: =$number($todayStart) + 604800000

tabs:
  home:
    jigId: home
    icon: home

Functions

We will use forRowsWithValues in the get-calendar-event-details function to update only one record in the calendarEvents table when called from onRefresh on the view-calendar-event-details jig. If you don't specify forRowsWithValues the entire table is wiped by the REST call and only the result is inserted. See REST Overview for more information on using forRowsWithValues with REST calls.

MS Graph Event Item function in GitHub.

get-calendar-events-details.jigx
provider: DATA_PROVIDER_REST
method: GET
url: https://graph.microsoft.com/v1.0/users/{userId}/calendars/{calendarId}/events/{calendarEventId}
outputTransform: $
parameters:
  accessToken:
    location: header
    required: true
    type: string
    value: microsoft.OAuth # Use manage.jigx.com to define credentials for your solution
  userId:
    type: string
    location: path
    required: true
  calendarId:
    type: string
    location: path
    required: true
  calendarEventId:
    type: string
    location: path
    required: true
forRowsWithValues:
  id: calendarEventId

Jigs

MS Graph Calendar Events jig in GitHub.

view-calendar-event-details
title: [email protected]
type: jig.default

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

children:
  - type: component.entity
    options:
      children:
        - type: component.entity-field
          options:
            label: Location
            value: [email protected]
        - type: component.field-row
          options:
            children:
              - type: component.entity-field
                options:
                  label: Day
                  value: =$fromMillis($toMillis(@ctx.jig.inputs.evtFrom), '[MNn] [D], [Y]', @ctx.system.timezone.offset)
              - type: component.entity-field
                options:
                  label: Time
                  value: |
                    = $fromMillis($toMillis(@ctx.jig.inputs.evtFrom), '[h]:[m01] [PN]', @ctx.system.timezone.offset)
                    & " to " & 
                    $fromMillis($toMillis(@ctx.jig.inputs.evtTo), '[h]:[m01] [PN]', @ctx.system.timezone.offset)
        - type: component.entity-field
          options:
            label: Online Meeting
            value: [email protected]
            contentType: link
            href: [email protected]
            isTrackingTransparencyRequired: false
            isHidden: [email protected]? false:true
        - type: component.entity-field
          options:
            label: Summary
            value: [email protected]
            isMultiline: true
  - type: component.expander
    options:
      isInitiallyCollapsed: true
      header:
        centerElement:
          type: component.titles
          options:
            title: Task Message (Expand to Read)
      children:
        - type: component.web-view
          options:
            isTrackingTransparencyRequired: false
            height: 400
            content: |
              =("
              <html>
                <head>
                  <meta name=" & "'" & "viewport" & "'" & " content=" & "'" & "width=device-width, " & "initial-scale=1" & "'" & "/>
                </head>
                <body>" 
                  & @ctx.jig.inputs.bodyContent
              & "</body>
              </html>")
  - type: component.list
    options:
      data: [email protected]
      maximumItemsToRender: 8
      item:
        type: component.list-item
        options:
          title: [email protected]
          divider: solid
          subtitle: "='Status: ' & @ctx.current.item.status.response"
          label:
            title: [email protected]
            color:
              - when: [email protected] = 'required'
                color: color2
              - when: [email protected] != 'required'
                color: color7
          leftElement:
            element: avatar
            text: =$uppercase(@ctx.current.item.emailAddress.name)

actions:
  - children:
      - type: action.open-url
        options:
          title: Join Meeting
          url: [email protected]
          isHidden: |
            [email protected]? false: true

preview:
  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
  isCompact: false
  children:
    - type: component.entity
      options:
        children:
          - type: component.entity-field
            options:
              label: Subject
              value: [email protected]
              contentType: default
          - type: component.field-row
            options:
              children:
                - type: component.entity-field
                  options:
                    label: Day
                    value: =$fromMillis($toMillis(@ctx.jig.inputs.evtFrom), '[MNn] [D], [Y]', @ctx.system.timezone.offset)
                - type: component.entity-field
                  options:
                    label: Time
                    value: |
                      = $fromMillis($toMillis(@ctx.jig.inputs.evtFrom), '[h]:[m01] [PN]', @ctx.system.timezone.offset)
                      & " to " & 
                      $fromMillis($toMillis(@ctx.jig.inputs.evtTo), '[h]:[m01] [PN]', @ctx.system.timezone.offset)
          - type: component.entity-field
            options:
              label: Summary
              value: [email protected]
              isMultiline: true
    - type: component.web-view
      options:
        isTrackingTransparencyRequired: false
        height: 400
        content: |
          =("
          <html>
            <head>
              <meta name=" & "'" & "viewport" & "'" & " content=" & "'" & "width=device-width, " & "initial-scale=1" & "'" & "/>
            </head>
            <body>" 
              & @ctx.jig.inputs.bodyContent
          & "</body>
          </html>")
  actions:
    # - when: [email protected] = 1
    - children:
        - type: action.open-url
          options:
            title: Join Meeting
            url: [email protected]
            isHidden: |
              [email protected]? false: true

See Also

Last updated

Was this helpful?