i would like to formatt my Microsoft List as follow:
I would like to color every second row gray and in addition, when a status is set to Completed, set the complete row to green.
Can someone help me with the JSON Code?
Thanks.
Greetings Phil
Use JSON like below for your SharePoint JSON view formatting settings:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$Status]=='Completed','sp-field-severity--good',if(@rowIndex%2==0,'sp-css-backgroundColor-BgLightGray30','sp-css-backgroundColor-noFill'))"
}
Where Status
is the internal name of your SharePoint list column. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?
Output:
Steps to add JSON: