Graph API Sharepoint list, filter by createdDateTime

Dev 9 86 Reputation points
2022-08-24T13:25:59.713+00:00

This graph query

    https://graph.microsoft.com/v1.0/sites/<Site ID>/lists/<list ID>/items?$filter=fields/Created+ge+'2021-08-01T08:00'  

for the custom column Created gives results, but the filter produces inaccurate results.

        {  
            "columnGroup": "Custom Columns",  
            "description": "",  
            "displayName": "Created",  
            "enforceUniqueValues": false,  
            "hidden": false,  
            "id": "12345",  
            "indexed": true,  
            "name": "Created",  
            "readOnly": true,  
            "required": false,  
            "dateTime": {  
                "displayAs": "default",  
                "format": "dateTime"  
            }  
        },  

When I try

https://graph.microsoft.com/v1.0/sites/<Site ID>/lists/<list ID>/items?$filter=createdDateTime+ge+'2022-01-01T00:00:00Z'  

I get

{  
    "error": {  
        "code": "BadRequest",  
        "message": "Invalid filter clause",  
        "innerError": {  
            "date": "2022-08-24T13:13:55",  
            "request-id": "12345",  
            "client-request-id": "678910"  
        }  
    }  
}  
  

Does the list item query not support "createdDateTime"? Can I eventually query the Created column differently, since it is a dateTime column?

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

2 answers

Sort by: Most helpful
  1. Vicky Kumar (Mindtree Consulting PVT LTD) 1,161 Reputation points Microsoft Employee
    2022-08-24T18:36:52.8+00:00

    Yes , This is a known issue, the /sites/{site id}/lists , currently filter is not supported for list fields such as "Name", "lastModifiedDateTime', "createdDateTime',webUrl...etc.

    If you want this feature to be added, then you can submit User Voice to add support for the filter.

    ----------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Anh Vo 0 Reputation points
    2023-03-25T17:23:05.26+00:00

    @Dev 9 hi friend, could you try to add new column for saving DateTime as string ?

    Then, the request should update this column in every add item/ edit item.

    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.