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 have two lists that are using the same Managed Metadata column. I am attempting to copy this column when I create a new entry in one of the lists. My code looks like this:

        SPListItem li = site.RootWeb.Lists["UploadList"].AddItem();
        li["Title"] = workflowProperties.Item["Title"];
        li["TaxKeyword"] = (TaxonomyFieldValueCollection)workflowProperties.Item["TaxKeyword"]; 

For some reason when I look at the new list item that is created it never has a value for the "TaxKeyword" column. I have tried not casting it to TaxonomyFieldValueCollection and it still does not work... Any suggestions on how to do this?

share|improve this question

When setting the value of Taxonomy Fields always use TaxonomyField.SetFieldValue

var sourceValue = sourceItem["SColumn"] as TaxonomyFieldValueCollection; 
var targetField = targetList.Fields["TColumn"] as TaxonomyField; 
targetField.SetFieldValue(targetItem, sourceValue);

Just setting targetItem["field"] doesn't update the hidden notes field or the hidden lookuplist

share|improve this answer

Use PopulateFromGuidValuePair method. Below is a snippet to set Managed Column value from another one.

TaxonomyFieldValueCollection sourceTaxVal = sourceItem["MMColumn"] as TaxonomyFieldValueCollection;
string taxVal = string.Empty;
foreach (TaxonomyFieldValue val in sourceTaxVal)
    taxVal += val.Label + "|" + val.TermGuid + ";";
 //taxVal = sourceItem["MMColumn"].ToString() //will also result in same value as above
 TaxonomyFieldValueCollection targetTaxVal = new TaxonomyFieldValueCollection(targetList.Fields["MMColumn"]);
 targetItem["MMColumn"] = targetTaxVal;
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.