Forum Discussion
Sourceress
Oct 28, 2022Iron Contributor
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...
- 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.
ganeshsanap
Oct 28, 2022MVP
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.
Sourceress
Oct 29, 2022Iron Contributor
ganeshsanap this is glorious! Thank you ever so much: you are a superstar :sparkler: