A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi Zoe,
Thanks for posting in the community. We are happy to help you.
Based on my test, please check if the following JSON code helps.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if(@currentField == '', '', if(@currentField < @now, 'red', if(@currentField <= @now + 31536000000, 'yellow', 'green')))",
"font-weight": "bold"
}
}
If the above JSON code doesn't work well, since your query is related to JSON code, and we have a specific channel Microsoft Q&A Community coping with JSON code questions, I would like to suggest you post a new thread (assign the tag SharePoint) there for expert help.
Also, we welcome community members to share ideas about the situation if one has related experiences.
Sincerely,
George | Microsoft Community Moderator