Forum Discussion
Help with JSON format and SharePoint Column
- Apr 05, 2024
Sifiak Do you want to show it in one line? I think it is better and easy to show it on separate lines.
Also, you can add additional styling as per your requirements in style property.
Example: adding margin at the top like:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "style": { "display": "block", "margin-top": "5px" }, "elmType": "div", "children": [ { "elmType": "div", "forEach": "person in split([$TextColumn],';')", "txtContent": "=substring([$person],0,indexOf([$person],'<'))" } ] }
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.
Sifiak Try using SharePoint JSON column formatting like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"style": {
"display": "block"
},
"elmType": "div",
"children": [
{
"elmType": "div",
"forEach": "person in split([$TextColumn],';')",
"txtContent": "=substring([$person],0,indexOf([$person],'<'))"
}
]
}
Where [$TextColumn] is an internal name of your Request column in SharePoint list in this format: [$InternalNameOfColumn]. You can get the internal name of your SharePoint list columns by following this article: How to find the Internal name of columns in SharePoint Online?
Output:
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.
- SifiakApr 05, 2024Copper Contributorits almost great, i noticed that the names are below each other and somehow aligned to top, can they be centered vertically?
- ganeshsanapApr 05, 2024MVP
Sifiak Do you want to show it in one line? I think it is better and easy to show it on separate lines.
Also, you can add additional styling as per your requirements in style property.
Example: adding margin at the top like:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "style": { "display": "block", "margin-top": "5px" }, "elmType": "div", "children": [ { "elmType": "div", "forEach": "person in split([$TextColumn],';')", "txtContent": "=substring([$person],0,indexOf([$person],'<'))" } ] }
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.