1

I do not know JSON, so I am struggling to figure this out. I have a drop down menu column and if the user selects one of the drop down menus (Lets say its called "Peer Review - Rushed") I would like the cell to show red, or even the whole row if need be. How do I do that?

4
  • Do you need this in only the Modern UI, or both in Classic UI and Modern UI? JSON only works with the Modern UI. Commented Oct 26, 2018 at 20:10
  • Mike, I think just modern.
    – Klj126
    Commented Oct 26, 2018 at 21:13
  • @MikeSmith-MCT-MVP Just kidding, apparently people are using the classic, am I SOL because of this?
    – Klj126
    Commented Oct 26, 2018 at 22:03
  • No, just need a different solution. Classic uses JSLink. If no one else does... I'll try to post an example this weekend. Commented Oct 27, 2018 at 2:08

1 Answer 1

1

For the Modern UI and JSON:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "span",
  "debugMode": true,
  "txtContent": "@currentField",
  "style": {
    "color": "=if(@currentField == 'Peer Review - Rushed', 'Red', if(@currentField == 'Peer Review - Slow', 'Blue', 'Black'))"
  }
}

This will set Red, Blue, or if other Black.

  • Click the column heading's dropdown
  • Click Column Settings.
  • Click Format this column.
  • Copy and paste the JSON and click Save.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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