Forum Discussion
How to get the latest file from a SharePoint folder
Hi all,
I am trying to get the latest file from a SharePoint folder, using the path below:
= SharePoint.Files("https://XXXX.sharepoint.com/:f:/r/sites/SCOperatingSystem/PlanningSpace/Supply%20Planning/00%20-%20Data%20Files/12%20-%20VRP%20Planned%20Orders?csf=1&web=1&e=YAvzz9", [ApiVersion = 15])
However, I am getting the following Error Msg:
DataFormat.Error: The input URL is invalid. Please provide a URL to the root of a SharePoint site, or to the service document or entity of its OData feed (with no query or fragment part).
Details:
https://XXXX.sharepoint.com/:f:/r/sites/SCOperatingSystem/PlanningSpace/Supply%20Planning/00%20-%20Data%20Files/12%20-%20VRP%20Planned%20Orders?csf=1&web=1&e=YAvzz9
If I use this path: https://XXXX.sharepoint.com/:f:/r/sites/SCOperatingSystem/PlanningSpace there is no issue but not sure how I can select the next folder: Supply Planning
Cheers
Anonymous , refer to the code given for similar solution, if that can help
1 Reply
- amitchandak
Super User
Anonymous , refer to the code given for similar solution, if that can help