Issue using Microsoft Graph SDK filter clause in an Calendar/Events query.

John Pike 5 Reputation points
2023-03-23T14:40:12.4133333+00:00

Issue using Microsoft Graph SDK filter clause in an Calendar/Events query. Here is the actual c# code that I am having the problem with: var results = await eventServiceClient.Users[users[i].Id].Calendar.Events.Request().Top(999).Select("Start,End,Body,BodyPreview,Subject,CreatedDateTime,LastModifiedDateTime,Type").Filter("startDateTime ge 2023-03-20T08:00:00").GetAsync();

Microsoft Security | Microsoft Graph
0 comments No comments

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. John Pike 5 Reputation points
    2023-03-24T17:05:14.6+00:00

    Now that I have upgraded to version 5.3, how do I get the next page in multiple page results.

    Was this answer helpful?


  3. Siddharth Gautam 865 Reputation points
    2023-03-23T22:33:57.1533333+00:00

    Hello John Pike,

    Thanks for reaching out.

    As per my testing, you are not using the $filter query parameter on startDate Time property in right way. The correct way to write startDate Time is 'start/dateTime'.

    Please refer the below snippet for same:

    var result = await graphClient.Users["{user-id}"].Calendar.Events.GetAsync((requestConfiguration) =>
    {
        requestConfiguration.QueryParameters.Filter = " start/dateTime ge '2023-03-20T08:00:00Z'";
        requestConfiguration.QueryParameters.Select = new string []{ "Start","End","Body","BodyPreview","Subject","CreatedDateTime","LastModifiedDateTime","Type"};
    
    });
    

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    Was this answer helpful?

    0 comments No comments

Your answer

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