Allow $filter for clocked in datetime on Teams .../schedule/timeCards MS Graph API endpoint

Allow $filter for clocked in datetime on Teams .../schedule/timeCards MS Graph API endpoint
2

Upvotes

Upvote

 Nov 07 2023
2 Comments (2 New)
New

Currently when attempting to apply a filter related to clock in dates/times, such as the following query: 

 

https://graph.microsoft.com/beta/teams/{teamid}/schedule/timeCards?$filter=clockInEvent/dateTime lt 2023-05-02T00:00:00.000Z

 

generates the following error:

 

{
    "error": {
        "code": "BadRequest",
        "message": "The entity property 'clockInEvent/dateTime' and operationKind 'LessThan' is not allowed in $filter query.",
        "innerError": {
            "date": "2023-11-07T16:36:50",
            "request-id": "61282496-e52f-403d-b5be-70cccf396ec1",
            "client-request-id": "d2e5e59e-0bff-2c5e-cff4-3c44c069536e"
        }
    }
}

 

This means there is no effective way to limit the number of timecards downloaded for a given team, and if that team has thousands of records (not atypical), then all timecards must be downloaded even if processing just a single month's worth of timecards.  This may take a considerable time.  The same applies to the .../schedule/timesOff endpoint.

 

It is suggested that filtering on clock in (and potentially clock out) dates/times be allowed for specific dates and for date ranges (i.e., le and ge queries) in order to make this process much more efficient, both for the API user and for Microsoft as a provider.

Comments
Copper Contributor

Did you find a way to work around this limitation, other than downloading everything?

Copper Contributor

Sadly not, @Christian Heindel.

 

As it is such a problem for us, I did in fact raise a support ticket via our Azure subscription.  Somewhat inevitably, I got back the party line, that this is a beta offering and is not officially supported.  I was referred to the MS Graph forum at https://aka.ms/askGraph and have posted this same request there: Not possible to $filter on clocked in datetime on Teams .../schedule/timeCards MS Graph API endpoint....  Hopefully something will come of it.