1

I'm looking for a way to retrieve all files modified after a given time on SharePoint.

I've tried accessing the endpoints _api/web/lists/getbytitle (Query 1), which only seems to return folders and _api/web/GetFolderByServerRelativeUrl (Query 2), which only returns files in a given folder.

Is there a way to search all files changed after a certain date in a document library?

This is the documentation I'm using: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

Query 1:

https://bamgroup.sharepoint.com/sites/036222/_api/web/lists/getbytitle('Project%20Files')/items?$filter= Modified gt '2022-09-30T12:56:11'

Query 2:

https://bamgroup.sharepoint.com/sites/036222/_api/web/GetFolderByServerRelativeUrl('Project%20Files')/files?$filter= Modified gt '2022-09-30T12:56:11'

1 Answer 1

1

Try using this SharePoint REST API endpoint:

https://bamgroup.sharepoint.com/sites/036222/_api/web/lists/getbytitle('Project Files')/items?$filter=Modified gt datetime'2022-09-30T12:56:11.000Z'
5
  • Did that, but it only returns changed folders. bamgroup.sharepoint.com/sites/036222/_api/web/lists/… gt datetime'2022-10-04T09:00:00.000Z' That retrieves modified files and I missed the datetime in the formula..... Why do w add the .000Z Isn't 2022-10-04T09:00:00 already in that date time format? Commented Oct 4, 2022 at 13:33
  • Is it working for you as expected or not? Commented Oct 4, 2022 at 13:38
  • 1
    You can ignore .000Z part (milliseconds) as well if not required. Check different ways to filter based on date column in SharePoint REST API at: sharepoint.stackexchange.com/questions/255543/… Commented Oct 4, 2022 at 13:40
  • 1
    Yes working as expected now! thanks. Where do I click that you solved this? i can't find it Commented Oct 4, 2022 at 14:57
  • Great, glad it worked for you! Commented Oct 4, 2022 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.