Newer Version Available

This content describes an older version of this product. View Latest

Folder

Represents a folder. This type extends the Metadata metadata type and inherits its fullName field.

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”.

File Suffix and Directory Location

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.

Deploying or Retrieving Nested Folders

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 (/).

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>MyTopFolder/MyNestedFolder/</members>
5        <name>DocumentFolder</name>
6    </types>
7    <version>58.0</version>
8</Package>

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.

Version

Folders are available in API version 11.0 and later.

Fields

This metadata type contains the following fields:

Field Name Field Type Description
accessType FolderAccessTypes (enumeration of type string) Required. The type of access for this folder. Valid values are:
  • 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.
fullName string The name used as a unique identifier for API access. The fullName can 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.
name string Required. The name of the document folder.
publicFolderAccess PublicFolderAccess (enumeration of type string) If Public is the value for accessType, this field indicates the type of access all users have to the contents of the folder. Valid values include:
  • 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.
sharedTo SharedTo Sharing access for the folder. See Sharing Considerations in Salesforce Help.

Wildcard Support in the Manifest File

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.