Folder
Represents a folder.
Five folder types currently exist in Salesforce:
- Document folder
- Email folder (available for Salesforce Classic email templates only)
- Email Template folder
- Report folder
- Dashboard folder
Folder type names end with the “Folder” suffix. For example, the type name of a document folder is “DocumentFolder”.
This type extends Metadata and inherits its fields.
Folders are stored in the corresponding component directory of the package. These directories are named documents, email, emailTemplates, reports, and dashboards. Folders don’t have a text file representation—they’re containers for files. For each folder, an accompanying metadata file named FolderName.folderType-meta.xml is created at the same directory level. The FolderName.folderType-meta.xml metadata file contains the metadata information for that folder, such as the accessType. For example, for a documents folder named sampleFolder, there’s a sampleFolder.documentFolder-meta.xml within the documents folder of the package.
- Type: FolderAccessTypes (enumeration of type string)
- Required: No
- Description: Required. The type of access for this folder.
- Possible values:
- Shared — . This folder is accessible only by the specified set of users.
- Public — . This folder is accessible by all users, including portal users.
- PublicInternal — . This folder is accessible by all users, excluding portal users. This setting is available for report and dashboard folders in organizations with a partner portal or Customer Portal enabled.
- Hidden — . This folder is hidden from all users.
- Type: FolderShare[]
- Required: No
- Description:
- Type: string
- Required: No
- Description: The name used as a unique identifier for API access. The
fullNamecan contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is inherited from the Metadata component.
- Type: string
- Required: Yes
- Description: Required. The name of the document folder.
- Type: PublicFolderAccess (enumeration of type string)
- Required: No
- Description: If
Publicis the value for accessType, this field indicates the type of access all users have to the contents of the folder. Valid values include: - Possible values:
- ReadOnly — . All users can read the contents of the folder, but no user can change the contents.
- ReadWrite — . All users can read or change the contents of the folder.
- Type: SharedTo
- Required: No
- Description: Sharing access for the folder. See Sharing Considerations in Salesforce Help.
The following is the package manifest definition of a document folder that contains a document:
The following is an example of the sampleFolder-meta.xml metadata file for the sampleFolder document folder:
To deploy or retrieve only a nested folder component, and not its contents, you must use a specific syntax in your package.xml. To reference the nested folder itself, append a trailing slash (/) to its full name in the <members> tag.
For example, to retrieve a nested DocumentFolder named MyNestedFolder located inside MyTopFolder, your package.xml must list the member with a trailing slash (/).
If you omit the trailing slash (for example, <members>MyTopFolder/MyNestedFolder</members>), the operation fails. The API incorrectly searches for a Document component named MyNestedFolder instead of the folder.
This syntax applies to all folder types. For ReportFolder, you must use the Report type in the manifest. For Lightning Email Template folders, use the EmailTemplateFolder type.
Folders are available in API version 11.0 and later.
This metadata type doesn’t support the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.