ADO.NET Provider for Microsoft SharePoint

Build 26.0.9770

FolderOption

Specifies how the provider displays folders and files in query results.

Possible Values

FilesOnly, FilesAndFolders, RecursiveAll

Data Type

string

Default Value

"RecursiveAll"

Remarks

The FolderOption property determines how files and folders are displayed in query results for Microsoft SharePoint lists and libraries. The available options include:

  • FilesOnly: Returns only files from the specified list or library, excluding folders.
  • FilesAndFolders: Returns both files and folders from the specified list.
  • RecursiveAll: Returns all files from the specified list and all subfolders.

This property is useful for controlling the scope of query results when working with lists and libraries that contain nested folder structures. For the REST schema, filtering is applied server-side and affects document libraries only; it has no effect on non-document-library lists.

Performance Considerations

Selecting a recursive option such as RecursiveAll can increase query execution time and result set size, especially in lists with deep folder hierarchies. Using FilesOnly or FilesAndFolders may improve performance by reducing the scope of results and lowering data retrieval overhead.

Columns Required for Folder Scoping

To honor the FolderOption setting, the provider always exposes certain document-library columns as regular, queryable columns, even when the ShowHiddenColumns and ShowPredefinedColumns settings would otherwise hide them. This behavior applies to the REST schema and affects Microsoft SharePoint document libraries only.

The following columns are exposed:

  • The Path column (internal name FileDirRef) is always exposed, for every FolderOption value, because the provider uses it to scope query results to the correct folder or library root.
  • The Item Type column (internal name FSObjType) is exposed only when FolderOption is set to FilesOnly, because that mode must distinguish files (Item Type = 0) from folders.

The name under which each column appears depends on the UseDisplayNames property. When UseDisplayNames is enabled (the default), the display names Path and Item Type are used. When it is disabled, the internal names FileDirRef and FSObjType are used.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770