Forum Discussion
Laurie88
Jan 26, 2021Copper Contributor
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...
- 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
RobElliott
Jan 26, 2021Silver Contributor
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
- Laurie88Jan 27, 2021Copper Contributor
RobElliott That works perfectly. Thank you so much!