Forum Discussion

Laurie88's avatar
Laurie88
Copper Contributor
Jan 26, 2021
Solved

SharePoint List - Highlight a cell based on status of a different cell

Hi there,   I would like to format some date cells on a SharePoint List so they are highlighted a different colour if the corresponding cell on the adjacent column has 'Confirmed' entered. I've add...
  • RobElliott's avatar
    Jan 26, 2021

    Laurie88 very straightforward with JSON column formattingClick on the NJ Launch dropdown > column settings >format this column, then click on the advanced mode link and add the following:

     

    {
    "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
    "elmType": "div",
    "txtContent": "@currentField",
    "style": {
    "padding-left": "14px",
    "background-color": "=if([$Condition] == 'Confirmed','#00c36f', (if([$Condition] == 'Provisional','#ff7e00', '#d0d0d0')))",
    "color": "white"
    }
    }

     

     

    and the result looks like this and you can then hide the Condition column:

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

Resources