Introduction
This article talks about how to extract a term label from the Managed Metadata column. The list that includes a Managed Metadata column or Taxonomy Field stores the data in the following format.
| Column Name | Column Type | Simple Value | Data Format |
| Location | Taxonomy Field | 2; # Chennai | WSS Id; Name of Team |
| Location TaxHTField0 | Note | Chennai | c61d9028-824f-446e-9389-eb9515813a42 | Name of Term | GUID of Term |
The WSS identifier is a 32-bit integer that uniquely identifies list's list item containing the taxonomy field. This property behaves similarly to the LookupId property and is used as the lookup identifier on the TaxonomyHiddenList list.
Practical Scenario
Please find the following is the Managed Metadata column named "Location” added in Test List in SharePoint Site.
Now I have added a new list item with Term Value as Chennai for Location.
Please have a look at the following helper method that will extract only a Term Label value from the Managed Metadata column.
- /// <summary>
- /// method to get value from Taxonomy field column from splistItem
- /// </summary>
- /// <param name="spListItem">object of splistItem</param>
- /// <param name="taxonomyField">taxonomy field column name</param>
- /// <returns>returns a string of Term label</returns>
- public static string GetTaxonomyFieldValue(SPListItem spListItem, string taxonomyField)
- {
- string fieldValue = string.Empty;
- try
- {
- TaxonomyFieldValueCollection spTaxonomyFiledValueCollection = spListItem
- [taxonomyField] as TaxonomyFieldValueCollection;
- foreach (var field in spTaxonomyFiledValueCollection)
- {
- fieldValue = field.Label;
- }
- }
- catch (Exception exception)
- {
- //Log an exception
- throw;
- }
- return fieldValue;
- }
GetTaxonomyFieldValue(oSPListItem,"Location")
This will return a term label as "Chennai" and if you need a Term GUID then replace the field.Label property with the field.Guid.
Happy SharePointing!

nbc nbcPosted Nov 27, 2017, 5:40 AM
Hi Ketak,Is there any way to get the Description of the Taxonomy Term, not the Label?Thank you in advance.
Gowtham RajamanickamPosted May 2, 2015, 4:52 AM
good