Forum Discussion
Sharepoint list how to wrap text in gallery view
I inadvertently posted this question on another board. I'm not a programmer and just getting introduced to JSON via my duties in SharePoint. I can get the following to work on Kudos field via column formatting. I can see this in list view. How do I get same word wrap formatting added to gallery tile view JSON? When I add the following to JSON in gallery view, the text field disappears. Kudos is single line text field. I'll be able to adjust the tile height/width but stuck on word wrap. Thank you in advance.
{"elmType": "div", "style":{ "white-space":"wrap" }, "txtContent": "@Kudos" }
Where does the above json go in gallery view JSON below?
{
"elmType": "div",
"attributes": {
"class": "sp-card-displayColumnContainer"
},
"children": [
{
"elmType": "p",
"attributes": {
"class": "ms-fontColor-neutralSecondary sp-card-label"
},
"txtContent": "[!Kudos.DisplayName]"
},
{
"elmType": "p",
"attributes": {
"title": "[$Kudos]",
"class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent"
},
"txtContent": "=if ([$Kudos] == '', '–', [$Kudos])"
}
]
}
JeffThiel Try using below JSON:
{
"elmType": "div",
"attributes": {
"class": "sp-card-displayColumnContainer"
},
"children": [
{
"elmType": "p",
"attributes": {
"class": "ms-fontColor-neutralSecondary sp-card-label"
},
"txtContent": "[!Kudos.DisplayName]"
},
{
"elmType": "p",
"attributes": {
"title": "[$Kudos]",
"class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent"
},
"txtContent": "=if ([$Kudos] == '', '–', [$Kudos])",
"style": {
"white-space": "wrap"
}
}
]
}
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.