0

By default, it seems when you select multiple Terms from a Managed Metadata column in a Document Library, SharePoint Online will display each Term on its own line, eg:

Some_Tag_01  
Some_Tag_02  
Some_Tag_03  

However, a Choice column that allows multiple selections will display selected options as:

Some_Choice_01, Some_Choice_02, Some_Choice_03

It looks like Managed Metadata columns are now supported in column formatting:

Supported column types

Is there a way to display multiple selected Terms separated by commas, so that they can be displayed on one line?

1 Answer 1

2

Add below JSON on managed metadata column:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField"
}

Output:

enter image description here


Or this:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=join(@currentField, ', ')"
}

Output:

enter image description here

4
  • 1
    you read my mind with the second option, looks much cleaner, thank you. Jun 5, 2021 at 11:00
  • i don't suppose you would know how to do this with values in a column of type Person or Group? the above solution returns this on a Person or Group column: [object Object], [object Object] Jun 24, 2021 at 11:15
  • 1
    Can you please ask a new question for this & add more details to your new question. I will have a look into it. will be easier to manage it separately. Jun 24, 2021 at 11:18
  • 1

Your Answer

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

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