Filter Groups by createdDateTime

Matt Hamilton 6 Reputation points
2022-06-14T02:05:47.823+00:00

There are years-old questions on Stack Overflow for this one, but I thought I'd post here to see if the people closer to the metal have an update.

Is it possible yet to filter the /groups endpoint based on createdDateTime? For example, I would like to get a list of the groups created in the past seven days, but any attempt to use the createdDateTime attribute in the $filter parameter is being met with errors.

Cheers,
Matt

Microsoft Security | Microsoft Graph
0 comments No comments

3 answers

Sort by: Most helpful
  1. Matt Hamilton 6 Reputation points
    2022-06-15T01:37:54.317+00:00

    Thanks gang. Getting all groups and filtering client-side is my strategy right now, but I was really hoping that someone from the Graph team was going to see this and say "oh yeah, we've got that working and it'll be live in a week" or something. :)

    I appreciate your replies.

    Was this answer helpful?

    1 person found this answer helpful.

  2. Srinivasa Rao Darna 6,851 Reputation points Microsoft External Staff
    2022-06-14T12:28:42.937+00:00

    Hi @Matt Hamilton ,

    As per documentation group resource type supports $filter (eq, ne, not, ge, le, in) on createdDateTime. And to use $filter on Azure AD objects should use aad-advanced-queries and group properties seems not mentioned here and returns filter property that is not indexed.

    GET /groups?$count=true&$filter=createdDateTime ge 2022-01-01T00:00:00Z  
    ConsistencyLevel: eventual  
    
    "code": "Request_UnsupportedQuery",  
    "message": "The request uses a filter property that is not indexed",  
    

    I will keep posted on this thread.

    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

  3. 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

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.