TagSet defines a classification category that groups related Tag records. The set represents the category; its Tags represent individual classification values. For example, a TagSet named DataDomain could group Tags such as Financial, Operational, and Legal.
TagSets can form parent-child hierarchies for progressively finer classifications. Do not confuse that hierarchy with the tags collection: tags contains Tag definitions, not child TagSet definitions.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The metadata component's full name, inherited from Metadata. It is separate from the required name and label fields. |
name |
Required. The set's unique name within the org. Only alphanumeric characters and underscores are allowed. It must begin with a letter, contain no spaces or consecutive underscores, and not end with an underscore. |
label |
Required. Identifies the set in the Salesforce user interface. |
options |
A collection of set-level options. Each entry has a string name and a boolean value of true or false. |
properties |
A collection of set-level properties. Each entry has a string name and a string value. |
tags |
The Tag definitions included in this set. Each nested Tag can carry its own identity, description, label, name, options, and properties. |
Behavior and Constraints
Keep component identity and display text distinct. TagSet inherits fullName, but it also requires both name and label. The label supplies the user-interface text; the name must satisfy the org-wide uniqueness and character rules.
Keep set-level and Tag-level configuration separate. A TagSet and each nested Tag can have their own options and properties. The structures use the same name/value format, but that shared structure does not establish inheritance or override behavior between the set and its Tags. When comparing definitions, distinguish entries on the set from entries inside individual tags.
A parent TagSet can contain one or more child TagSets to create more granular classifications. The tags element is not the place to encode those child sets.
Deployment and Retrieval
TagSet components use the .tagSet file suffix and are stored in the tagSet folder.
TagSet does not support the * wildcard in package.xml, the manifest that selects components for deployment or retrieval. Enumerate TagSet component members explicitly rather than relying on wildcard selection.
Use listMetadata(), the Metadata API discovery call, to discover custom Tags and TagSets in the org and identify the members to select.
Relationships
TagSet extends Metadata and inherits its fullName field. Its classification values are contained Tag definitions. A parent-child relationship between TagSets is distinct from that containment.
References
-
Tag:tags.
Common Questions
Why doesn't a wildcard retrieve my TagSets?
TagSet does not support * in package.xml. Use listMetadata() to discover custom Tags and TagSets, then list the TagSet members explicitly.
Where are TagSet metadata files stored?
They are stored in the tagSet folder and use the .tagSet suffix.
Does the tags element contain child TagSets?
No. It contains Tag definitions representing classification values. TagSets can form parent-child hierarchies, but that hierarchy is separate from the tags collection.
Do TagSet options automatically apply to every Tag?
The shared option structure does not establish automatic inheritance or overrides. Treat set-level options and properties separately from those nested inside each Tag.
What characters can a TagSet name contain?
The required name must be unique in the org and use only alphanumeric characters and underscores. It must begin with a letter, contain no spaces or consecutive underscores, and not end with an underscore.