Forum Discussion

E_Mahn's avatar
E_Mahn
Copper Contributor
Jun 05, 2020
Solved

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): { ...
  • RobElliott's avatar
    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

Resources