Request to get all items in a list, including items in subfolders in SharePoint

I have a list of document libraries. I created folders in this list and uploaded some files to these subfolders. How to get all these files that are in subfolders in this list of document libraries using SPQuery ?

+1
source share
1 answer

If you want to request all folders and subfolders in a list or document library, you need to define additional query parameters. If you are working with the object model, you need to set the ViewAttributes property of the SPQuery object as follows:

qry.ViewAttributes = "Scope = 'Recursive'";

+5
source

All Articles