Question

I am new to this forum.

I have a list that has a choice field with about 20 options (each varying in length). I want to display each choice on a new line (text wrap).

Default View looks like this>

enter image description here

I would prefer it to look like this:

enter image description here

I heard that JSON formatting on the column might be able to achieve this but I have never used that before.

If you need more information let me know. Any help would be appreciated.

Était-ce utile?

La solution

As you are using SharePoint Online, you can try using anyone of the below:

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

Reference: Organize multi-choice user inputs by separate line (not comma)

OR

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "div",
      "style": {
        "display": "block",
        "width": "100%"
      },
      "forEach": "choice in @currentField",
      "txtContent": "[$choice]"
    }
  ]
}

Reference: Rendering multi-value Choice fields vertically using JSON Column Formatting

Official documentation: Use column formatting to customize SharePoint

Autres conseils

You could try this:

{
    "$schema":
    "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "txtContent": "=join(@currentField, '\n')"
 }
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top