Forum Discussion
E_Mahn
Jun 05, 2020Copper Contributor
Using AND function in column formatting
I am trying to create relatively simple conditional column formatting in a SharePoint Online list. This works (the conditions 1==1 and 2==2 are placeholders to simplify the examples here): {
...
- Jun 05, 2020
E_Mahn you need to be using && between the 2 criteria of the if statement, for example:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "color": "=if([$FlowHasRun]=='No' && [$Status2]=='Completed' , '#468259', '#c00000')" } }Rob
Los Gallardos
Microsoft Power Automate Community Super User
RobElliott
Jun 05, 2020Silver Contributor
E_Mahn you need to be using && between the 2 criteria of the if statement, for example:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if([$FlowHasRun]=='No' && [$Status2]=='Completed' , '#468259', '#c00000')"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User
E_Mahn
Jun 05, 2020Copper Contributor
RobElliott Thanks!!