Share via

Microsoft Lists JSON formatting

Wattsville Blues 1 Reputation point
Dec 20, 2021, 3:41 PM

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!

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,071 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,406 Reputation points Microsoft Vendor
    Dec 21, 2021, 8:06 AM

    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.