I don't understand why my question was deleted before. I was told to post here by Rhoda Zhong - Microsoft Community Moderator and post my question. So I'll try again. Having trouble with entering tags, but I'll do my best.
Hi
I have tried to edit some JSON code to change the colour of list entries in calendar view - the wizard only allows me to apply conditional formatting to the title or date fields, so I edited the JSON code to apply to the name of a different column - "activity". But for some reason it doesn't do anything in my calendar entries. Can anyone help? I've made sure the spelling of the criteria is correct and the name of the field is spelled correctly.
I'm using Microsoft 365 and editing the calendar via the app in my browser. Using Chrome.
Here is my JSON code, which I created by using the wizard initially using the "Title" field and then I change the word "Title" to "Activity" as the name of the field/column I want the conditional formatting to use. Thanks in advance.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"additionalEventClass": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Awareness Days / Weeks / Months"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgBlue' , 'sp-css-backgroundColor-BgCornflowerBlue sp-css-color-CornflowerBlueFont')",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Publication"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgGreen' , 'sp-css-backgroundColor-BgMintGreen sp-css-color-MintGreenFont')",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Blog"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgBrown' , 'sp-css-backgroundColor-BgGold sp-css-color-GoldFont')",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Podcast"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkRed' , 'sp-css-backgroundColor-BgCoral sp-css-color-CoralFont')",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Newsletter/Gov Del"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgTeal' , 'sp-css-backgroundColor-BgCyan sp-css-color-CyanFont')+' sp-field-fontSizeSmall'",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Conference"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgOrange' , 'sp-css-backgroundColor-BgPeach sp-css-color-PeachFont')+' sp-field-fontSizeSmall'",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Meeting"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkPink' , 'sp-css-backgroundColor-BgLilac sp-css-color-LilacFont')+' sp-field-fontSizeSmall'",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Event"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkGreen' , 'sp-css-backgroundColor-BgSage sp-css-color-SageFont')+' sp-field-fontSizeSmall'",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Email"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgLavender' , 'sp-css-backgroundColor-BgLightPurple sp-css-color-LightPurpleFont')+' sp-field-fontSizeSmall'",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Activity]",
"Add to comms plan"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkPurple' , 'sp-css-backgroundColor-BgViolet sp-css-color-VioletFont')+' sp-field-fontSizeSmall'",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Type of Activity / Action]",
"Revisit for decision"
]
},
"=if(@isSelected == true, 'sp-css-color-WhiteFont sp-css-backgroundColor-BgDarkBlue' , 'sp-css-backgroundColor-BgLightBlue sp-css-color-LightBlueFont')+' sp-field-fontSizeSmall'",
""
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
}