0

I am trying to change the background color of each row in SharePoint list on office 365. I have been looking online for two days there are so many solutions and most of them don't work on new list experience. My main objective to conditional format a row based on a value of a status column. can someone help me with this?

  • what are the conditions to color the rows? – Ganesh Sanap Mar 12 at 5:27
2

Yes, it is possible.

You can use View Formatting in Office 365 to color the rows based on the Status field.

Use below JSON code to color the rows in your list:

{
  "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "additionalRowClass": "=if([$Status] == 'Done', 'sp-field-severity--good', if([$Status] == 'In progress', 'sp-field-severity--low' ,if([$Status] == 'In review','sp-field-severity--warning', if([$Status] == 'Has issues','sp-field-severity--blocked', ''))))"
}

You can put above code by selecting Format current view option as given below:

enter image description here

Reference: 1. Use view formatting to customize SharePoint.

Update:

To use customized colors and formatting you need to use rowFormatter in JSON formatting:

You can find view samples on GitHub.

  • sorry I wasn't clear with my question. I need specific color not predefined color . is this possible? – Ehsan Aliverdi Mar 12 at 5:44
  • Which colors do you want? – Ganesh Sanap Mar 12 at 6:05
  • in this case, you need to use rowFormatter. check updated answer. – Ganesh Sanap Mar 12 at 6:21
  • I need to do this for several lists. I need to have at least 20 different colors. – Ehsan Aliverdi Mar 12 at 21:49
  • You need to add the json code in each list separately. – Ganesh Sanap Mar 13 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.