SearchFilesAndFolders
Searches for files and folders in a Dropbox account based on specified criteria.
Execute
The SearchFilesAndFolders stored procedure searches for files and folders in a Dropbox account based on specified criteria. The procedure uses the Dropbox search API to find items that match the provided search terms.
Search Behavior
Important: The Name parameter performs a fuzzy search across the Dropbox API. This means:
- Results may include files and folders that contain the search term, not just exact matches. However, some results may not be returned, especially when using very few characters in the search string.
- When FilenameOnly is true (default), the search is limited to file and folder names only.
- This procedure can retrieve a maximum of 10,000 matches.
- Recent changes may not immediately be reflected in search results due to a short delay in indexing.
- Duplicate results may be returned across pages.
Required Parameters
- Name - The search string. This is the only required parameter and will be used to search for matching files and folders.
Basic Usage Examples
Search for files and folders containing "report" in their names:
EXEC SearchFilesAndFolders Name = 'report'
Search for exact filename match only:
EXEC SearchFilesAndFolders Name = 'quarterly_report.pdf', FilenameOnly = true
Search within a specific folder path:
EXEC SearchFilesAndFolders Name = 'budget', Path = '/Documents/Finance'
Advanced Filtering Examples
Filter by file extensions (search for Excel files):
EXEC SearchFilesAndFolders Name = 'data', FileExtensions = 'xlsx,xls'
Filter by file categories:
EXEC SearchFilesAndFolders Name = 'presentation', FileCategories = 'document,spreadsheet'
Search with highlights enabled (shows matching text spans):
EXEC SearchFilesAndFolders Name = 'project', IncludeHighlights = true
Team Space Search
For Dropbox Business accounts, search within a specific team member's space:
EXEC SearchFilesAndFolders Name = 'contract', AccountId = 'dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc'
Search Tips
- Use short, specific search terms for better performance
- Combine Path parameter with Name to search within specific folders
- Use FileExtensions to quickly find files of specific types
- The search is case-insensitive
- Partial word matching is supported (searching "doc" will find "document.pdf")
Input
| Name | Type | Required | Description |
| Name | String | True | The string to search for. May match across multiple fields based on the request arguments. |
| FilenameOnly | Boolean | False | When the value is 'true', search only by file or folder name.
The default value is true. |
| Path | String | False | The path to search in (defaults to root if not specified). |
| FileExtensions | String | False | Comma-separated list of file extensions to filter by. |
| FileCategories | String | False | Comma-separated list of file categories to filter by. |
| AccountId | String | False | Account ID to search within a team space. |
| IncludeHighlights | Boolean | False | Indicates whether to include highlight span from file title. The default value for this field is 'false'. |
Result Set Columns
| Name | Type | Description |
| Id | String | Unique identifier for the file or folder. |
| Name | String | The name of the file or folder. |
| Type | String | Type of item (file or folder). |
| PathDisplay | String | The canonical path to display. |
| ClientModified | Datetime | Timestamp of last client modification. |
| ContentHash | String | A hash of the file's content. |
| HasExplicitSharedMembers | Boolean | Indicates whether the file has explicitly shared members. |
| IsDownloadable | Boolean | Indicates whether the file can be downloaded. |
| PathLower | String | The lowercase version of the path. |
| Rev | String | A unique identifier for the current revision. |
| ServerModified | Datetime | Timestamp of last server modification. |
| Size | Number | Size of the file in bytes. |
| SharingInfoModifiedBy | String | ID of user who last modified sharing. |
| SharingInfoParentSharedFolderId | String | ID of parent shared folder. |
| SharingInfoReadOnly | Boolean | Indicates whether the file is read-only. |
| HighlightSpans | String | Highlight span of a file title. |