🔍 Code Extractor

class FilePickerOptions

Maturity: 34

A configuration class for SharePoint file picker options that extends ClientValue to specify search settings and organizational asset repositories.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/publishing/file_picker_options.py
Lines:
5 - 18
Complexity:
simple

Purpose

FilePickerOptions is used to configure the behavior of SharePoint's file picker component. It allows enabling/disabling Bing search integration and specifying organizational asset repositories (both central and org-specific) that should be available in the file picker interface. This class is typically used when customizing the file selection experience in SharePoint Publishing scenarios.

Source Code

class FilePickerOptions(ClientValue):
    def __init__(
        self,
        search_enabled=None,
        central_asset_repository=OrgAssets(),
        org_assets=OrgAssets(),
    ):
        self.BingSearchEnabled = search_enabled
        self.CentralAssetRepository = central_asset_repository
        self.OrgAssets = org_assets

    @property
    def entity_type_name(self):
        return "SP.Publishing.FilePickerOptions"

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

search_enabled: Boolean flag to enable or disable Bing search functionality within the file picker. When True, users can search for files using Bing. When False or None, Bing search is disabled. Default is None.

central_asset_repository: An OrgAssets instance representing the central asset repository configuration. This defines the centralized location for organizational assets that should be accessible through the file picker. Default is a new OrgAssets() instance.

org_assets: An OrgAssets instance representing organization-specific assets configuration. This defines org-level assets that should be available in the file picker, separate from the central repository. Default is a new OrgAssets() instance.

Return Value

Instantiation returns a FilePickerOptions object configured with the specified search and asset repository settings. The object can be serialized as a ClientValue for use with SharePoint REST API calls. The entity_type_name property returns the string 'SP.Publishing.FilePickerOptions' which identifies this object type in SharePoint's type system.

Class Interface

Methods

__init__(self, search_enabled=None, central_asset_repository=OrgAssets(), org_assets=OrgAssets())

Purpose: Initializes a new FilePickerOptions instance with search and asset repository configurations

Parameters:

  • search_enabled: Boolean or None to enable/disable Bing search in file picker
  • central_asset_repository: OrgAssets instance for central asset repository configuration
  • org_assets: OrgAssets instance for organization-specific assets configuration

Returns: None (constructor)

@property entity_type_name(self) -> str property

Purpose: Returns the SharePoint entity type name for this class, used for serialization and API communication

Returns: String 'SP.Publishing.FilePickerOptions' representing the SharePoint entity type

Attributes

Name Type Description Scope
BingSearchEnabled bool or None Flag indicating whether Bing search is enabled in the file picker interface instance
CentralAssetRepository OrgAssets Configuration object for the central organizational asset repository accessible through the file picker instance
OrgAssets OrgAssets Configuration object for organization-specific assets accessible through the file picker instance

Dependencies

  • office365
  • office365.runtime.client_value
  • office365.sharepoint.administration.orgassets.org_assets

Required Imports

from office365.runtime.client_value import ClientValue
from office365.sharepoint.administration.orgassets.org_assets import OrgAssets

Usage Example

from office365.runtime.client_value import ClientValue
from office365.sharepoint.administration.orgassets.org_assets import OrgAssets
from office365.sharepoint.publishing.file_picker_options import FilePickerOptions

# Create file picker options with Bing search enabled
options = FilePickerOptions(
    search_enabled=True,
    central_asset_repository=OrgAssets(),
    org_assets=OrgAssets()
)

# Access the entity type name for SharePoint API calls
entity_type = options.entity_type_name  # Returns 'SP.Publishing.FilePickerOptions'

# Access configured properties
bing_enabled = options.BingSearchEnabled  # True
central_repo = options.CentralAssetRepository  # OrgAssets instance
org_assets = options.OrgAssets  # OrgAssets instance

# Use with SharePoint client context (typical usage)
# ctx.web.file_picker.configure(options)
# ctx.execute_query()

Best Practices

  • Always instantiate with appropriate OrgAssets objects if you need to configure specific organizational asset repositories
  • Set search_enabled explicitly to True or False rather than leaving as None for clarity
  • This class is immutable after instantiation - create a new instance if you need different settings
  • Use this class as part of SharePoint Publishing API calls, not as a standalone configuration object
  • Ensure proper SharePoint authentication context is established before using FilePickerOptions in API calls
  • The entity_type_name property is used internally by the Office365 library for serialization - typically you don't need to access it directly

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SharePointOneDriveOptions 67.8% similar

    A data class that encapsulates search content options for SharePoint and OneDrive searches performed using application permissions.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/sharepoint_onedrive_options.py
  • class PickerSettings 66.6% similar

    Configuration settings class for the SharePoint client people picker control, providing access to picker behavior settings and query configurations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/picker_settings.py
  • class MoveCopyOptions 63.9% similar

    A configuration class that encapsulates options for move and copy operations in SharePoint, controlling behavior like conflict resolution, metadata preservation, and lock bypassing.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/utilities/move_copy_options.py
  • class PeoplePickerQuerySettings 62.0% similar

    A data class representing additional settings for SharePoint principal queries, specifically for people picker operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/query_settings.py
  • class SiteInfoForSitePicker 61.8% similar

    A data transfer object representing site information for SharePoint site picker operations in Microsoft Online SharePoint Tenant Administration.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/siteinfo_for_site_picker.py
← Back to Browse