2

I'm using a SharePoint lookup column that has a multi-select choice field.

When 2 or more values are selected for an item, it is displayed in the view like this:

Value1;Value2;Value3;Value4;Value5;Value6

Is there a way that I can display this field as shown below?

Value1

Value2

Value3

Value4

Value5

Value6

1 Answer 1

1

Try below JSON formatting on your multi-lookup column in list view to show data vertically:

 {
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "debugMode": true,
  "elmType": "div",
  "children": [
    {
      "elmType": "div",
      "style": {
        "display": "block",
        "width": "100%"
      },

      "txtContent": "=join(@currentField.lookupValue, '\n')"
    }
  ]
}
4
  • This works pretty much perfectly. I had to adjust the width so that the string didn't just wrap at the edge of the column width. This still happens if your manually drag the width of the column, but it works. May 6, 2020 at 15:51
  • Glad this works. Kindly try after removing width line from json. So you will not have to drag the column. May 6, 2020 at 15:54
  • I've ran into a bit of an issue. When the width of each item is too short it still goes to one line. Is there anyway to explode the results and break them by the ; and then have them sorted like a regular HTML list? May 6, 2020 at 16:04
  • List this... Example May 6, 2020 at 16:09

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.