JSON formatting to show in bold AND conditional fomatting based upon dates

Stephen Cox 41 Reputation points
2021-11-26T14:08:07.38+00:00

Hello,

I posted this question in the Microsoft Community forum: https://answers.microsoft.com/en-us/msoffice/forum/all/sharepoint-lists-conditional-formatting-very/c70832f1-a6a6-40cb-a7f7-ec8f318547c3, but I've been advised to post it in the Microsoft Q&A section instead. I've found the answer to my question through having a search through the Tech Community: https://techcommunity.microsoft.com/t5/sharepoint/conditional-format-sharepoint-list-due-dates-with-three/m-p/1586928

What I'd also like to do is to have the data that appears in the column to present in bold. How do I combine the recommended JSON in: https://techcommunity.microsoft.com/t5/sharepoint/conditional-format-sharepoint-list-due-dates-with-three/m-p/1586928 with some additional lines to achieve this?

I've been able to apply the background colours to the column, but I can't figure out how to add the additional JSON language to make the text to appear bold too.

Your advice and guidance would be much appreciated, as I'm a complete novice at this, so thank you in advance!

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,855 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,052 questions
0 comments No comments
{count} votes

Accepted answer
  1. Echo Du_MSFT 17,186 Reputation points
    2021-11-29T02:07:30.937+00:00

    Hello @Stephen Cox ,

    Welcome to Q&A Forum!

    Please use the below JSON formatting:

    {  
        "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
        "elmType": "div",  
        "txtContent": "@currentField",  
        "style": {  
            "background-color": "=if(Number(@currentField) == 0, '', if(@currentField >= @now + 2592000000, '#AFF8C9', if(@currentField >= @now + 86400000, '#EEBB2F', if(@currentField <= @now, '#F06C47',''))))",  
    		"font-weight": "bold"   
        }  
    }  
    

    153202-json.jpg

    Reference:

    Thanks,
    Echo Du

    =============================================================

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.