Forum Discussion

Sourceress's avatar
Sourceress
Iron Contributor
Oct 28, 2022
Solved

SPO List Gallery view JSON: Split (or wrap) array of managed metadata column values across new lines

Hi All,   I have an SPO List, using Gallery view. Of four columns of data that display on the cards, one is a managed metadata column called 'Values' (corporate values) that allows multiple select...
  • ganeshsanap's avatar
    Oct 28, 2022

    Sourceress Instead of 

     

    {
      "elmType": "p",
      "attributes": {
        "title": "[$Values]",
        "class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent",
        "role": "heading",
        "aria-level": "3"
      },
      "txtContent": "=if ([$Values] == '', '–', [$Values])",
      "style": {
        "word-break": "keep-all"
      }
    }

     

    Use this

     

    {
      "elmType": "p",
      "attributes": {
        "title": "[$Values]",
        "class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent",
        "role": "heading",
        "aria-level": "3"
      },
      "forEach": "tag in [$Values]",
      "children": [
        {
          "elmType": "span",
          "txtContent": "[$tag]"
        }
      ],
      "style": {
        "word-break": "keep-all"
      }
    }

     


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources