---
schema_version: "1"
id: 57672422c7720c23212069c72de110032ee93f20faa818dfc6dd1f21b8cafef7
title: describeValueType()
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_describeValueType.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_describeValueType.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1e1bdeffc3ada1c37ef7cb21195c48fee29c82b666136c10e774edce2e2a23dd
description: Retrieves the metadata describing a given metadata type (value type).
---
# describeValueType()

Retrieves the metadata describing a given metadata type (value type).

describeValueType() accepts a namespace and a type name, and returns a DescribeValueTypeResult object. This call is available in API version 33.0 and later.

## Syntax

DescribeValueTypeResult = connection.describeValueType("{namespace}type\_name");

## Example

Describe Apex class metadata in the Metadata namespace:

DescribeValueTypeResult = metadataConnection.describeValueType("{http://soap.sforce.com/2006/04/metadata}ApexClass");

Describe Apex class metadata in the Tooling namespace:

DescribeValueTypeResult = toolingConnection.describeValueType("{urn:metadata.tooling.soap.sforce.com}ApexClass");

## Arguments

### type

- **Type**: string
- **Description**: The name of the metadata type for which you want metadata; for example, ApexClass. Include the namespace.

## Permissions

Your client application must be logged in with the Modify Metadata Through Metadata API Functions or Modify All Data permission.

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png)

#### Note

If a user requires access to metadata but not to data, enable the [Modify Metadata Through Metadata API Functions](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_metadata_perm.htm "To use Metadata API, a user must have these things.") permission. Otherwise, enable the Modify All Data permission.

## Sample Code—Java

The following example describes several metadata types by specifying the Metadata namespace. Each metadata type is described using the helper method, doDescribe(), which calls the describeValueType() Metadata API call. The sample retrieves information from the returned DescribeValueTypeResult: a property, the parent field (if any), and the fields. Next, the sample iterates through the fields and outputs information about each field.

public void describeValueType() throws ConnectionException {
    doDescribe("{http://soap.sforce.com/2006/04/metadata}CustomObject");
    doDescribe("{http://soap.sforce.com/2006/04/metadata}CustomField");
    doDescribe("{http://soap.sforce.com/2006/04/metadata}EmailTemplate");
}

public void doDescribe(String type) throws ConnectionException {
    DescribeValueTypeResult result = metadataConnection.describeValueType(type);
    StringBuffer sb = new StringBuffer();

    sb.append("Describing " + type + " ...\\n");

    if (result.getApiCreatable() == true) {
        sb.append("Is API creatable.\\n");
    } else {
        sb.append("Is not API creatable.\\n");
    }

    ValueTypeField parentField = result.getParentField();
    if (parentField != null) {
        sb.append("\*\* Parent type fields \*\*\\n");
        if (parentField.getIsForeignKey()) {
            sb.append("This field is a foreign key.\\n");
            for (String fkDomain : parentField.getForeignKeyDomain()) { 
                sb.append("Foreign key domain: " + fkDomain + "\\n");
            }
        }              
    }

    sb.append("\*\* Value type fields \*\*\\n");
    for(ValueTypeField field : result.getValueTypeFields()) {
        sb.append("\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\\n");
        sb.append("Name: " + field.getName() + "\\n");
        sb.append("SoapType: " + field.getSoapType() + "\\n");
        if (field.getIsForeignKey()) {
            sb.append("This field is a foreign key.\\n");
            for (String fkDomain : field.getForeignKeyDomain()) { 
                sb.append("Foreign key domain: " + fkDomain + "\\n");
            }
        }
        sb.append("\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\\n");
    }
    System.out.println(sb.toString());
}

To run the previous example with the Tooling WSDL, replace the namespace with the Tooling namespace in the helper function call as follows. Also, use the Tooling connection instead of the Metadata connection to make the describeValueType() call.

    doDescribe("{urn:metadata.tooling.soap.sforce.com}CustomObject");
    doDescribe("{urn:metadata.tooling.soap.sforce.com}CustomField");
    doDescribe("{urn:metadata.tooling.soap.sforce.com}EmailTemplate");

After you run the sample, the output looks similar to the following.

Describing {http://soap.sforce.com/2006/04/metadata}CustomObject ...
Is API creatable.
\*\* Value type fields \*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: actionOverrides
SoapType: ActionOverride
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: allowInChatterGroups
SoapType: boolean
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: articleTypeChannelDisplay
SoapType: ArticleTypeChannelDisplay
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: businessProcesses
SoapType: BusinessProcess
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: compactLayoutAssignment
SoapType: string
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: compactLayouts
SoapType: CompactLayout
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: customHelp
SoapType: string
This field is a foreign key.
Foreign key domain: ApexPage
Foreign key domain: Scontrol
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
<The rest of the output for CustomObject has been omitted for brevity.>

Describing {http://soap.sforce.com/2006/04/metadata}CustomField ...
Is API creatable.
\*\* Parent type fields \*\*
This field is a foreign key.
Foreign key domain: CustomObject
\*\* Value type fields \*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Name: caseSensitive
SoapType: boolean
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Name: defaultValue
SoapType: string
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

<The rest of the output has been omitted for brevity.>

## Response

[DescribeValueTypeResult](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_describeValueTypeResult.htm "Contains information about a value type that’s useful for developers working with declarative metadata.")