Forum Discussion
List conditional formatting with multiple conditions and column references
- Apr 05, 2021
TanyaMc yes you can do this and the result is shown below:
For the Explanation column the JSON that you need to paste into the Advanced mode window is as follows:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "padding-left": "14px", "background-color": "=if(@currentField == '' && [$Expired] == 'Y', '#ff7e00', if(@currentField != '' ,'#85b18e', '#cacfd6')", "color": "white" } }
For the Comments column the JSON is:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "padding-left": "14px", "background-color": "=if(@currentField != '', '#85b18e', if(([$Explanation] == 'Other (provide comments)' || ([$Explanation] == 'Renewed'),'#ff7e00', '#cacfd6' )", "color": "white" } }
Hope that helps.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
TanyaMc yes you can do this and the result is shown below:
For the Explanation column the JSON that you need to paste into the Advanced mode window is as follows:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"padding-left": "14px",
"background-color": "=if(@currentField == '' && [$Expired] == 'Y', '#ff7e00', if(@currentField != '' ,'#85b18e', '#cacfd6')",
"color": "white"
}
}
For the Comments column the JSON is:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"padding-left": "14px",
"background-color": "=if(@currentField != '', '#85b18e', if(([$Explanation] == 'Other (provide comments)' || ([$Explanation] == 'Renewed'),'#ff7e00', '#cacfd6' )",
"color": "white"
}
}
Hope that helps.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
- TanyaMcApr 05, 2021Copper ContributorPerfect! Many many thanks!