SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a SharePoint 2013 publishing approval workflow that needs to compare if a managed metadata field in a newly created item is set to a specific value. This in order to assign a task to a sharepoint group if the condition is true. I'm having difficulties in finding the value of the MMD field. I've tried to do it in the Term|GUID-way(Term|xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). But I don't get any values at all.

If anyone has some pointers or advice on this issue, it would be great!

Thanks, Joakim

share|improve this question

Here is a snippet that I have used to set the values in a TaxonomyField in SharePoint 2010.

However the object model hasn't changed too much in this area:-

This code is expecting an SPListItem object to be passed through.

string labelValue = String.Empty;
TaxonomyField field = item.Fields.GetField(fieldName) as TaxonomyField;
string fieldValue = item[field.Id].ToString();

TaxonomyFieldValue taxonomyFieldValue = new TaxonomyFieldValue(field);
string fieldValue = item[field.Id].ToString();
if (fieldValue.Contains("|"))

labelValue = taxonomyFieldValue.Label;

You can now compare the value inside labelValue with the value you need to check.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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