CAML request returns [object Object] for a field that contains managed metadata. How does that get converted to a value that can be display on the web. For example, I know that a lookup field requires a .get_lookupValue() but I don't know how to handle a managed metadata field.

Assistance greatly appreciated.


1 Answer 1


There are 2 methods to query a list/library that contains a managed metadata column:

  1. Query against Term Name
  2. Query Against WSSID

Method 1 (will look something similar to this):

 query.Query = @"<Where>
                      <FieldRef Name='" + MyTaxonomyFieldName + @"' />
                      <Value Type='Text'>" + tagName + @"</Value>

Method 2:

query.Query = @"<Where>
                   <FieldRef LookupId='TRUE' Name='" + MyTaxonomyField + @"' />
                       <Value Type='Integer'>" + tagLookupID + @"</Value>

it is recommended to use the second method to avoid situations where the term name is used under different term groups!

  • Thanks that is helpful in building a query for a specific value. However, I'm pulling ALL the managed metadata and want to display in the html: markup += '<td>' + listItem.get_item('TaxKeyword') + '</td>'; this displays as [object Object] I need to add to the get Item() so that the assigned managed metadata valus(s) will display.
    – PianoMan
    Commented Jun 6, 2016 at 17:03
  • I believe you can get it like this: var mngMetadataColumn = item.get_item('test'); var mngMetadataColumnLabel = mngMetadataColumn.get_label(); Commented Jun 6, 2016 at 18:59
  • Ahmed, Thanks but it did not work. Would you be able to point me to some documentation stating what types of field type need to be converted and how to do it. Thanks
    – PianoMan
    Commented Jun 6, 2016 at 20:19
  • Hope this helps you: vrdmn.com/2012/12/working-with-taxonomy-and-javascript-in.html Commented Jun 6, 2016 at 23:19
  • Thanks Ahmed. It appears to be a bit more complex them simply listing the contents of a text field. I will need to rethink. Again Thanks
    – PianoMan
    Commented Jun 7, 2016 at 0:53

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.