How to search by last modified data and time to fetch recently modified records. Results should contain all the nested children and grand children

Amitabh Dudekula 0 Reputation points
2023-03-30T01:23:32.4166667+00:00

We are trying to search for last modified records in SharePoint online by using below search query https://graph.microsoft.com/v1.0/sites/siteId/drives/driveId/root/search(q='2023-03-27')

But we are not getting accurate match for the date, instead we are getting matches for 2023 as well as part of results.

Our objective is to search by lastModifiedDateTime so that we can manipulate on the modified results. We need al grand children items as well as part of results.

Please suggest on this

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,516 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,559 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,655 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CharanyaB-MSFT 1,421 Reputation points Microsoft Vendor
    2023-03-30T10:00:59.8166667+00:00

    Hello @Amitabh Dudekula,

    Thanks for reaching out!

    You can use search API to query the drive items, you can refer the API from the below screenshot. In the search request body, you can mention the path to scope the query to a particular folder within a site and filter it based on LastModifiedTime. This gives you the customized results based on modified date of an item.

    SPOSearch

    Documentation reference:

    https://learn.microsoft.com/en-us/graph/search-concept-files#example-5-use-filters-in-search-queries

    Hope this helps.

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

    0 comments No comments