So, you want to migrate some documents that have managed metadata columns from another source into SharePoint Online.

Microsoft.SharePoint.Taxonomy is blocked.

Microsoft.SharePoint.Client.Taxonomy is 2013 only?

...and other remote ways are blocked for various reasons.

I was thinking possibly something like:

item["Country"] = "-1;#" + strCountryTag;
item["f80750f091f94eed8a5edc234d010620"] = getTermWithGuid(strCountryTag, "Country");

Like you would with the client object model, but this doesn't work like this. (-1 is because the taxonomy hidden list is empty so I don't need to look up WSSIDs)

Does anyone know of something that will make the code work in the example, so you can use Managed Metadata fields like you would a standard 2010 installation just with a custom bit of code?

Please presume that all the term guids are accessible at this point.

1 Answer 1


The Country column has to be updated in this form: <WssId>;#<Label>|<TermGuid> and the linked, hidden text field has to be updated with <Label>|<TermGuid>

<WssId> should be an index in the TaxonomyHiddenList if the term exists in that list, but passing -1 seems to work too.

This works on the SP2013 version of Office365, and on-premise SP2010 and SP2013.

This MSDN blog has more details.

  • That didn't work. Also getTermWithGuid does format it correctly. But it still won't update regardless.
    – Hugh Wood
    Commented Dec 6, 2012 at 9:31
  • Could you please double check that you have the right Guid? Do this by starting fiddler and editing the properties of an item with a taxonomy column. When you type and the term the autocompletion has found a term, look at the last call to /_vti_bin/TaxonomyInternalService.json/GetSuggestions. Open the JSON tab and look at d.Groups.Suggestions and verify that your DefaultLabel and Id match the ones you use in getTermWithGuid(). Is this SP2010?
    – ErikE
    Commented Dec 6, 2012 at 11:30
  • Yes, all the guids are correct. and there is an easier way, request a document in office and look at the cached xml folder, it stores the metadata locally for you. It just doesn't update the field when trying to enter the data as you suggested or any other way I tried.
    – Hugh Wood
    Commented Dec 6, 2012 at 11:34
  • But you did give myself an idea just now. If office can update the Managed Metadata I can just rip it's method off with fiddler2 :) sending you 10pt for reminding me about fiddler, I was going to run it on a migration tool and see how it did it, but there is no need. Office does it.
    – Hugh Wood
    Commented Dec 6, 2012 at 11:57
  • 1
    @ErikE thanks for spotting the mistake; that was a bug in my script and it's now fixed :)
    – Glorfindel
    Commented Nov 9, 2021 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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