Forum Discussion
SharePoint "Choice" Site Column Hides Text In Some Lists But Not In Others
Hello all,
We've got a site column we're using for projects. The idea is that we can add projects to the site column and have it become an option in all lists that have the "Project" column instead of having to go into each list and individually to add a project.
The issue is that when we try to format the site column to put different color highlights behind each project, some lists start to show a blank option in the column. These blank options are still the actual projects but the text and highlighting doesn't show. The weird thing is that this only happens in some lists. In other lists the projects and highlighting all shows just as expected. What could cause certain lists to work well with the site column and not others? JSON at the bottom of this post. Thank you!
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"flex-wrap": "wrap",
"display": "flex"
},
"children": [
{
"elmType": "div",
"style": {
"box-sizing": "border-box",
"padding": "4px 8px 5px 8px",
"overflow": "hidden",
"text-overflow": "ellipsis",
"display": "flex",
"border-radius": "16px",
"height": "24px",
"align-items": "center",
"white-space": "nowrap",
"margin": "4px 4px 4px 4px"
},
"attributes": {
"class": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Project]",
"ProjectNameXYZ"
]
},
"sp-css-backgroundColor-BgCornflowerBlue sp-field-fontSizeSmall sp-css-color-CornflowerBlueFont",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Project]",
"ProjectNameXYZ"
]
},
"sp-css-backgroundColor-BgMintGreen sp-field-fontSizeSmall sp-css-color-MintGreenFont",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Project]",
"ProjectNameXYZ"
]
},
"sp-css-backgroundColor-BgGold sp-field-fontSizeSmall sp-css-color-GoldFont",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Project]",
"ProjectNameXYZ"
]
},
"sp-css-backgroundColor-BgLilac sp-field-fontSizeSmall sp-css-color-CoralFont",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Project]",
"ProjectNameXYZ"
]
},
"sp-css-backgroundColor-BgDustRose sp-field-fontSizeSmall sp-css-color-DustRoseFont",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Project]",
"ProjectNameXYZ"
]
},
"sp-css-backgroundColor-BgCyan sp-field-fontSizeSmall sp-css-color-CyanFont",
"sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderColor-neutralSecondary"
]
}
]
}
]
}
]
}
]
}
]
}
},
"txtContent": "[$Project]"
}
]
}
2 Replies
SharePointHelp678 Did you change any column settings at list level (like rename, etc.) after adding the site column in your list which might have break some connection with actual site column and site column added to SharePoint list?
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.
- SharePointHelp678Copper ContributorNot that I am aware of. Infact, this seems to happen most often when I add the site column to a new list. So in that case it happens right when I add the site column to the new list and before I would have had a chance to accidentally change anything at the list level. It's very odd!