ListFilesFromFolder
Lists files from a specified folder in a SharePoint document library. Uses a folder-scoped query to avoid the List View Threshold, supporting libraries with more than 5,000 items.
Stored Procedure-Specific Information
To execute this procedure, enter:EXEC ListFilesFromFolder LibraryName='Shared Documents', FolderServerRelativePath='Shared Documents/data', Scope='Recursive'
Input
| Name | Type | Required | Description |
| LibraryName | String | True | The name of the document library (e.g., 'Shared Documents'). Must match the library name as it appears in FolderServerRelativePath. |
| FolderServerRelativePath | String | True | The server-relative path of the target folder (e.g., '/sites/Site/Shared Documents/SubFolder'). |
| Scope | String | False | Controls whether subfolders are included. FilesOnly returns only files directly in the specified folder. Recursive returns files in the specified folder and all subfolders.
使用㝧㝝る値㝯次㝮㝨㝊り㝧㝙。FilesOnly, Recursive デフォルト値㝯FilesOnly㝧㝙。 |
Result Set Columns
| Name | Type | Description |
| ID | Int | The unique identifier of the list item. |
| EncodedAbsUrl | String | The absolute URL of the file, encoded for use in HTTP requests. |
| FileSizeDisplay | String | The human-readable size of the file (e.g., '12 KB'). |
| Modified | Datetime | The date and time the file was last modified. |
| FileDirRef | String | The server-relative path of the folder that contains the file. |