---
schema_version: "1"
id: 2df3581af00fb6e00de5ef1ce5c79c74f7f5141d6a01bc8586426fc8dd0b30ab
title: Folder
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_folder.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_folder.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: ce00347d0d6e2cb60cb8bd0b2493440fdefc9801741eb5441ce8f1466b194022
description: Represents a folder. This type extends the Metadata metadata type and inherits its fullName field.
---
# 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 (/).

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
        <members\>MyTopFolder/MyNestedFolder/</members\>
        <name\>DocumentFolder</name\>
    </types\>
    <version\>58.0</version\>
</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:

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d525698e200">Field Name</th>

              <th class="featureTableHeader  " id="d525698e203">Field Type</th>

              <th class="featureTableHeader  " id="d525698e206">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d525698e200" data-title="Field Name"><span class="keyword parmname" id="folder_accesstype"><a name="folder_accesstype"><!-- --></a>accessType</span></td>

              <td class="entry" headers="d525698e203" data-title="Field Type">FolderAccessTypes (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)</td>

              <td class="entry" headers="d525698e206" data-title="Description">Required. The type of access for this folder. Valid values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">Shared</samp>. This folder is
                    accessible only by the specified set of users.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Public</samp>. This folder is
                    accessible by all users, including portal users.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">PublicInternal</samp>. <span class="ph" id="PublicInternalDesc"><a name="PublicInternalDesc"><!-- --></a>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.</span>
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Hidden</samp>. This folder is
                    hidden from all users.
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d525698e200" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d525698e203" data-title="Field Type">string</td>

              <td class="entry" headers="d525698e206" data-title="Description">The name used as a unique identifier for API access. The
                <span class="keyword parmname">fullName</span> 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 <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a>
                component.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d525698e200" data-title="Field Name"><span class="keyword parmname">name</span></td>

              <td class="entry" headers="d525698e203" data-title="Field Type">string</td>

              <td class="entry" headers="d525698e206" data-title="Description">Required. The name of the document folder.</td>

            </tr>

            <tr>
              <td class="entry" headers="d525698e200" data-title="Field Name"><span class="keyword parmname">publicFolderAccess</span></td>

              <td class="entry" headers="d525698e203" data-title="Field Type">PublicFolderAccess (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)</td>

              <td class="entry" headers="d525698e206" data-title="Description">If <samp class="codeph nolang">Public</samp> is the value for
                <a class="xref" href="#folder_accesstype">accessType</a>, this field indicates the type of access all users
                have to the contents of the folder. Valid values include:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">ReadOnly</samp>. All users can
                    read the contents of the folder, but no user can change the
                    contents.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">ReadWrite</samp>. All users
                    can read or change the contents of the folder.
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d525698e200" data-title="Field Name"><span class="keyword parmname" id="field_sharedTo"><a name="field_sharedTo"><!-- --></a>sharedTo</span></td>

              <td class="entry" headers="d525698e203" data-title="Field Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharedto.htm" title="SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.">SharedTo</a></td>

              <td class="entry" headers="d525698e206" data-title="Description">
                <span class="ph" id="field_sharedTo_desc"><a name="field_sharedTo_desc"><!-- --></a>Sharing access for the folder.</span>
                See <a class="xref" href="https://help.salesforce.com/s/articleView?id=platform.security_sharing_considerations.htm&amp;type=5&amp;language=en_US" target="_blank">Sharing Considerations</a> in
                Salesforce Help.
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is the package manifest definition of a document folder that contains a document:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName\>basic</fullName\>
    <types\>
        <members\>sampleFolder</members\>
        <members\>sampleFolder/TestDocument.txt</members\>
        <name\>Document</name\>
    </types\>
    <version\>68.0</version\>
</Package\>

The following is an example of the sampleFolder-meta.xml metadata file for the sampleFolder document folder:

<?xml version="1.0" encoding="UTF-8"?>
<DocumentFolder xmlns="http://soap.sforce.com/2006/04/metadata">
    <accessType\>Public</accessType\>
    <name\>sampleFolder</name\>
    <publicFolderAccess\>ReadWrite</publicFolderAccess\>
</DocumentFolder\>

## 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](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).

1. [FolderShare](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_foldershare.htm)  
    Represents the settings for enhanced analytics folder sharing. Users can control access to reports or dashboards by giving others Viewer, Editor, or Manager access to the folder that contains the report or dashboard.

#### See Also

- [Dashboard](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_dashboard.htm "Represents a dashboard. Dashboards are visual representations of data that allow you to see key metrics and performance at a glance.")
- [Document](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_document.htm "Represents a Document. All documents must be in a document folder, such as sampleFolder/TestDocument.")
- [EmailTemplate](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_emailtemplate.htm "Represents a template for an email, mass email, list email, or Sales Engagement email. Supported in first-generation managed packages only.")
- [Report](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_report.htm "Represents a custom report. This metadata type only supports custom reports; standard reports aren’t supported.")