How Search or get the documents in subfolders of Document library in SharePoint
Option 1 Using CAML Query
below CAML query used to filter
Sites/SiteCollectionName/SubsiteName/DocumentLibraryName/Folder Name/SubFolderName/SubSubFolderName/SubSubSubFolderName
Source
https://sharepoint.stackexchange.com/questions/60495/caml-query-for-sub-folder-documents-javascript
https://sharepoint.stackexchange.com/questions/59216/get-all-files-from-sub-folder-of-a-certain-content-type
https://sharepoint.stackexchange.com/questions/215230/get-all-items-in-list-by-field-name-caml-query
Option 2 Create a View which can point to SubFolder by changing the filter for the view using SharePoint Designer
Source: https://www.tombenjamin.ca/blog/designer/view/using-caml-query-show-files-folder/
Option 1 Using CAML Query
below CAML query used to filter
Source
https://sharepoint.stackexchange.com/questions/60495/caml-query-for-sub-folder-documents-javascript
https://sharepoint.stackexchange.com/questions/59216/get-all-files-from-sub-folder-of-a-certain-content-type
https://sharepoint.stackexchange.com/questions/215230/get-all-items-in-list-by-field-name-caml-query
Option 2 Create a View which can point to SubFolder by changing the filter for the view using SharePoint Designer
Source: https://www.tombenjamin.ca/blog/designer/view/using-caml-query-show-files-folder/
There is a thread on social.technet where someone asks how to “Create a webpart to show subfolder of existing document library.” I had posted a reply to that explaining how to modify a library view in SharePoint Designer to show files from just one folder. I can illustrate the process here with some screenshots so that it is easier to follow.
The first step is done using the browser. You need to create the view for your library so that it shows files inside the folders of your library. That option ignores the folders and shows all of the files, regardless of what folder they are in. When you create the view, select the columns you want to display, how you want them sorted and select the Folders option “show all items without folders”
Then in SharePoint Designer (SPD) open the site, on the left is the Navigation and Site Objects pane. Under Site Objects click on Lists and Libraries, select the library. The Views will be displayed on the right, click on the view you’ve created.
In the code view, scroll down until you see the XsltListViewWebPart (a library view is a page with one ListView web part). In the XML you’ll see a
tag inside the
tag. It will have an
tag (for sorting).
Add a
tag and then use either the
option, which would return you files from a folder and its sub-folders.
Or the
option, which will return files from just one single folder
Remember to use closing tags as shown.
If you want to check the folder names before adding the
clause you can add the
to the
tag.
Then save and preview your view – use it to get the correct value for the folder names.
Comments
Post a Comment