---
schema_version: "1"
id: e592045a7d389c7188c2f80e462ec4663a3a5d55a55e557694cdb57501494216
title: FieldSet
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_fieldset.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_fieldset.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0a1804afc7da93233b76ea2cb40c5ac12f00b01f5c16b29c4f1851b60fca278a
description: Represents a field set. A field set is a grouping of fields. For example, you could have a field set that contains fields describing a user's first name, middle name, last name, and business title.
---
# FieldSet

Represents a field set. A field set is a grouping of fields. For example, you could have a field set that contains fields describing a user's first name, middle name, last name, and business title.

Field sets can be referenced on Visualforce pages dynamically. If the page is added to a managed package, administrators can add, remove, or reorder fields in a field set to modify the fields presented on the Visualforce page without modifying any code.

## Version

FieldSet components are available in API version 21.0 and later.

## Fields

| Field | Field Type | Description |
| --- | --- | --- |
| availableFields | [FieldSetItem](#FieldSetItem)\[\] | An array containing all the possible fields in the field set. |
| description | string | Required. A description provided by the developer that describes the field set. This is required. |
| displayedFields | [FieldSetItem](#FieldSetItem)\[\] | An array containing all the fields that are presented on the Visualforce page. The order in which a field is listed determines the order of appearance on the page. |
| label | string | Required. The label used to reference the field set. |

## FieldSetItem

FieldSetItem represents an individual field in a field set.

| Field | Field Type | Description |
| --- | --- | --- |
| field | string | Required. The name of a field in a standard or custom object. |
| isFieldManaged | boolean | Read-only. Denotes whether the field was added to the field set via a managed or unmanaged package. |
| isRequired | boolean | Read-only. Indicates whether the field is universally required (true) or not (false). |

## Declarative Metadata Sample Definition

A sample XML definition of a FieldSet component is shown below.

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <fieldSets\>
        <fullName\>FieldSetNames</fullName\>
        <availableFields\>
            <field\>MiddleName\_\_c</field\>
        </availableFields\>
        <availableFields\>
            <field\>Title\_\_c</field\>
        </availableFields\>
        <description\>FieldSet containing how to properly address someone</description\>
        <displayedFields\>
            <field\>FirstName\_\_c</field\>
        </displayedFields\>
        <displayedFields\>
            <field\>LastName\_\_c</field\>
        </displayedFields\>
        <label\>FieldSet Names</label\>
    </fieldSets\>
</CustomObject\>

## Wildcard Support in the Manifest File

This metadata type supports 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).

- [← Previous](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm "CustomField")
- [Next →](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_historyretentionpolicy.htm "HistoryRetentionPolicy")