How to expand Microsoft Graph extended properties in calendar events in a calendar view

Leon Zhou 1 Reputation point
2021-07-05T07:45:38.737+00:00

Using Microsoft Graph SDK, I realised that when I get events from a calendar events collection, the extended properties are in the response:

graphClient.Me.Calendar.Events
.Request()
.Expand("SingleValueExtendedProperties($filter=id eq 'String {00020329-0000-0000-C000-000000000046} Name MyExtendedProperty')")
.Select("SingleValueExtendedProperties")
.GetAsync()

But when I get them from a calendar view collection, the extended properties are omitted:

graphClient.Me.Calendar.CalendarView
.Request(new[]
{
    new QueryOption("StartDateTime", DateTime.UtcNow.AddMonths(-3).ToString("yyyy-MM-dd")),
    new QueryOption("EndDateTime", DateTime.UtcNow.AddMonths(3).ToString("yyyy-MM-dd"))
})
.Expand("SingleValueExtendedProperties($filter=id eq 'String {00020329-0000-0000-C000-000000000046} Name MyExtendedProperty')")
.Select("SingleValueExtendedProperties")
.GetAsync()

Does anyone know if this is a by-design restriction or if there's a way to expand the extended properties in the calendar view?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Shweta Choudhary 606 Reputation points Microsoft Employee
    2021-07-06T15:45:42.387+00:00

    I tried using Graph API's to expand extended properties in the calendar view and it worked for me.

    Sample Request - [Get] https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2015-11-26T19:00:00-08:00&endDateTime=2015-11-28T19:00:00-08:0&$expand=singleValueExtendedProperties($filter=id%20eq%20'String%20{66f5a359-4659-4830-9070-00040ec6ac6e}%20Name%20Fun')

    112284-extendedproperties.png

    Try and see if you could leverage Rest API's here.
    Hope this helps. Thanks!

    1 person found this answer helpful.
    0 comments No comments

  2. Leon Zhou 1 Reputation point
    2021-07-07T05:03:08.6+00:00

    @Shweta Choudhary was right, calendar view works with the expand even from the SDK.

    My mistake was assuming me/calendarView and me/events were supposed to return the same set of events.

    Turns out me/calendarView actually returns individual occurrences in a recurring series instead of the series master like in me/events.

    This was causing me to mistaken that my extended properties were not included, but in fact it was been pushed out to later pages due to the inclusion of individual occurrences in calendar view.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.