Dec 27 2021 11:11 AM
As the subject line indicates, I'm trying to get a list's content type description to show in the header.
{
"elmType": "div",
"attributes": {
"class": "ms-borderColor-neutralTertiary"
},
"style": {
"width": "99%",
"border-top-width": "0px",
"border-bottom-width": "1px",
"border-left-width": "0px",
"border-right-width": "0px",
"border-style": "solid",
"margin-bottom": "16px"
},
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"box-sizing": "border-box",
"align-items": "center"
},
"children": [
{
"elmType": "div",
"attributes": {
"iconName": "Street",
"class": "ms-fontSize-42 ms-fontWeight-regular ms-fontColor-themePrimary",
"title": "Details"
},
"style": {
"flex": "none",
"padding": "0px",
"padding-left": "0px",
"height": "36px"
}
}
]
},
{
"elmType": "div",
"attributes": {
"class": "ms-fontColor-neutralSecondary ms-fontWeight-bold ms-fontSize-24"
},
"style": {
"box-sizing": "border-box",
"width": "100%",
"text-align": "left",
"padding": "21px 12px",
"overflow": "hidden"
},
"children": [
{
"elmType": "div",
"txtContent": "Flower Crop Details Form: [CONTENT TYPE DESCRIPTION]"
},
{
"elmType": "a",
"txtContent": "View data in Excel for print-out",
"attributes": {
"target": "_blank",
"href": "https://me-my.sharepoint.com/personal/me/Documents/Office%20365%20Documents/Excel/Garden.xlsx?web=1",
"class": "ms-fontColor-themePrimary ms-borderColor-themePrimary ms-fontWeight-regular ms-fontSize-m ms-fontColor-neutralSecondary–hover ms-bgColor-themeLight–hover"
}
}
]
}
]
}
I would like it to show in the header text as written in the JSON code [CONTENT TYPE DESCRIPTION].
Yes, I can manually add it, but I want to use something like [$Description], but that syntax doesnt work.
I've tried to search but everything returns how to create a content type because the question contains the words "Content Type"
I'm beginning to think it may not be possible unless anyone has a snazzy trick MSFT hasn't mentioned or is located in a spot I've heretofore been unable to locate.
Thanks.
Dec 28 2021 02:23 AM
@Carl_Williams As per my research and trial & error (tried multiple times), I think it is not possible to show the content type description on list form using JSON.
Even we are not able to access other SharePoint default columns like ID, Created, Modified, etc. in form JSON.
Documentations:
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.
Dec 28 2021 08:04 AM
Dec 28 2021 09:17 PM
@Carl_Williams You're welcome. Happy Holidays!!
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.