I am working on building a server-side event receiver for SharePoint on-premises 2013. now I have a single value managed metadata column named "OrderCustomerName", and I want to get the term Label, as currently if I do the following:-

 var ccc = currentItem["OrderCustomerName"].ToString();

I will get value such as "customer ABC|[asdasdasdasdaspdasdas]", now I do not want to rely on doing substring to extract the Label value (customer ABC), rather I am trying to access the Label property for my managed metadata column.


You need to cast it as TaxonomyFieldValue.

Check the sample implementation:

TaxonomyFieldValue taxFieldValue = currentItem["OrderCustomerName"] as TaxonomyFieldValue;

var label = taxFieldValue.Label;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.