Microsoft Lists JSON formatting

Wattsville Blues 1 Reputation point
2021-12-20T15:41:12.387+00:00

I have a Microsoft Lists set up in which I need to amend the colours. The default choice pill colours have changed recently so I think JSON is the only way to customise them to my liking, but I don't know how. Help!

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2021-12-21T08:06:50.8+00:00

    Hi @Wattsville Blues ,
    You can refer to following JSON formatting to custom the color of the choice

    {  
       "elmType": "div",  
       "txtContent": "@currentField",  
       "style": {  
          "background-color": {  
             "operator": "?",  
             "operands": [  
                {  
                   "operator": "==",  
                   "operands": [  
                      "@currentField",  
                      "Completed"  
                   ]  
                },  
                "#ff0000",  
                {  
             "operator": "?",  
             "operands": [  
                {  
                   "operator": "==",  
                   "operands": [  
                      "@currentField",  
                      "Ongoing"  
                   ]  
                },  
                "#00ff00",  
                {  
             "operator": "?",  
             "operands": [  
                {  
                   "operator": "==",  
                   "operands": [  
                      "@currentField",  
                      "Scheduled"  
                   ]  
                },  
                "#FFA500 ",  
                ""  
             ]  
          }  
             ]  
          }  
             ]  
          }  
       }  
    }  
    

    But I will recommend you the following function if there have colors achieve your requirement. You can set the color like following pic
    159220-image.png


    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.



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.