---
schema_version: "1"
id: b4fa9c4f056b70106eaa9f7204b9d97e20aa36ef684edbba7a0a5240f217fa0c
title: FieldSetMember Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Schema_FieldSetMember.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_FieldSetMember.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: e4df22243b75b956d97c3b2e3e0d97a05df82db672ac55b1abc26f3624d4a7fe
description: Contains methods for accessing the metadata for field set member fields.Returns true if the field is required by the field’s definition in its sObject, otherwise, false.Returns a field path string in a format ready to be used in a dynamic SOQL query.Returns the text label that’s displayed next to the field in the Salesforce user interface.Returns true if the field is required by the field set, otherwise, false.Returns the field’s Apex data type. Returns the token for this field.
---
# FieldSetMember Class

Contains methods for accessing the metadata for field set member fields.

## Namespace

[Schema](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Schema.htm "The Schema namespace provides classes and methods for schema metadata information.")

## Usage

Use the methods in the Schema.FieldSetMember class to get details about fields contained within a field set, such as the field label, type, a dynamic SOQL-ready field path, and so on. The following example shows how to get a collection of field set member describe result objects for a specific field set on an sObject:

List<Schema.FieldSetMember> fields = 
    Schema.SObjectType.Account.fieldSets.getMap().get('field\_set\_name').getFields();

If you know the name of the field set in advance, you can access its fields more directly using an explicit reference to the field set:

List<Schema.FieldSetMember> fields = 
    Schema.SObjectType.Account.fieldSets.field\_set\_name.getFields();

#### See Also

- [FieldSet Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fieldsets_describe.htm#apex_methods_system_fieldsets_describe "Contains methods for discovering and retrieving the details of field sets created on sObjects.")

## FieldSetMember Methods

The following are methods for FieldSetMember. All are instance methods.

- **[getDBRequired()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_FieldSetMember.htm#apex_Schema_FieldSetMember_getDBRequired)**  
    Returns true if the field is required by the field’s definition in its sObject, otherwise, false.
- **[getFieldPath()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_FieldSetMember.htm#apex_Schema_FieldSetMember_getFieldPath)**  
    Returns a field path string in a format ready to be used in a dynamic SOQL query.
- **[getLabel()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_FieldSetMember.htm#apex_Schema_FieldSetMember_getLabel)**  
    Returns the text label that’s displayed next to the field in the Salesforce user interface.
- **[getRequired()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_FieldSetMember.htm#apex_Schema_FieldSetMember_getRequired)**  
    Returns true if the field is required by the field set, otherwise, false.
- **[getType()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_FieldSetMember.htm#apex_Schema_FieldSetMember_getType)**  
    Returns the field’s Apex data type.
- **[getSObjectField()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_FieldSetMember.htm#apex_Schema_FieldSetMember_getSObjectField)**  
    Returns the token for this field.

### getDBRequired()

Returns true if the field is required by the field’s definition in its sObject, otherwise, false.

#### Signature

public Boolean getDBRequired()

#### Return Value

Type: Boolean

### getFieldPath()

Returns a field path string in a format ready to be used in a dynamic SOQL query.

#### Signature

public String getFieldPath()

#### Return Value

Type: String

#### Example

See [Displaying a Field Set on a Visualforce Page](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fieldsets_describe.htm#FieldSetsDescribeExample) for an example of how to use this method.

### getLabel()

Returns the text label that’s displayed next to the field in the Salesforce user interface.

#### Signature

public String getLabel()

#### Return Value

Type: String

### getRequired()

Returns true if the field is required by the field set, otherwise, false.

#### Signature

public Boolean getRequired()

#### Return Value

Type: Boolean

### getType()

Returns the field’s Apex data type.

#### Signature

public Schema.DisplayType getType()

#### Return Value

Type: Schema.DisplayType

### getSObjectField()

Returns the token for this field.

#### Signature

public Schema.sObjectField getSObjectField()

#### Return Value

Type: [Schema.SObjectField](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectField.htm#apex_class_Schema_SObjectField "A Schema.sObjectField object is returned from the field describe result using the getController and getSObjectField methods.")