Multiple lines of data in txtContent of custom hover card
I have a list that I am building a custom view for that will be displayed on a SharePoint page. I would like to create a hovercard that displays some of the item’s properties like its title, description, and link. However, I’m stuck on how to add extra lines of data in the txtContent area.
{
“elmType”: “div”,
“style”: {
“font-size”:”12px”
},
“txtContent”:”@currentField”,
“customCardProps”: {
“openOnEvent”: “hover”,
“formatter”: {
“elmType”: “div”,
“txtContent”:”=’Tip: ‘ + [$TipTrickTitle]”,
“style”: {
“font-size”:”14px”,
“color”:”darkred”,
“padding”:”8px”
}
}
}
}
I’ve tried things like, “txtContent”:“=’Tip: ‘ + [$TipTrickTitle] + n + ‘Link: ‘ + [$Linktokb], thinking I could use the n to make it start a new line, then reference my column of data, but that didn’t work. The more I try other variants I find online, the more I lose my mind.
Is there a JSON expert willing to help me with what I’m hoping is a simple task! I do prefer the Excel-style expressions as I can’t wrap my head around the other method I can’t even name, but if I have to use that other method so be it 🙂
I have a list that I am building a custom view for that will be displayed on a SharePoint page. I would like to create a hovercard that displays some of the item’s properties like its title, description, and link. However, I’m stuck on how to add extra lines of data in the txtContent area. {
“elmType”: “div”,
“style”: {
“font-size”:”12px”
},
“txtContent”:”@currentField”,
“customCardProps”: {
“openOnEvent”: “hover”,
“formatter”: {
“elmType”: “div”,
“txtContent”:”=’Tip: ‘ + [$TipTrickTitle]”,
“style”: {
“font-size”:”14px”,
“color”:”darkred”,
“padding”:”8px”
}
}
}
} I’ve tried things like, “txtContent”:”=’Tip: ‘ + [$TipTrickTitle] + n + ‘Link: ‘ + [$Linktokb], thinking I could use the n to make it start a new line, then reference my column of data, but that didn’t work. The more I try other variants I find online, the more I lose my mind. Is there a JSON expert willing to help me with what I’m hoping is a simple task! I do prefer the Excel-style expressions as I can’t wrap my head around the other method I can’t even name, but if I have to use that other method so be it 🙂 Read More