Forum Discussion

Chonski950's avatar
Chonski950
Copper Contributor
Mar 02, 2023
Solved

Conditional formating rows in sharepoint list based on values

Hi,

I have a sharepoint list that is fed by a Powerapps form.

I'd like to color the rows according to the following parameters but I have no idea where to start from :

Condition 1 : if column 1 = 00000000 then red

Condition 2 : if one of the columns 9, 10, 11, 12 is empty, then orange

Condition 3 : if all the columns 9, 10, 11, 12 are "Yes" then green

 

Is this something easily doable by a beginner or should I avoid doing such changes?

Thanks a lot

  • HI Chonski950 

     

    this is conditional row formatting.
    Go to your list in SharePoint and select "All Items"->Format current view

    select "Conditional Formatting"



    Now set the set the formatting for  "Show all values as" to green as a default.

    Now click "Add a Rule"

    and select the rule and Formattig you want to apply


    You can add multiple rules like

    if column 1 is equal to "00000000" then red

    if column 9 is equal to "" (nothing, just leave empty) then orange
    if column 10 is equal to "" (nothing, just leave empty) then orange
    if column 11 is equal to "" (nothing, just leave empty) then orange
    if column 13 is equal to "" (nothing, just leave empty) then orange
    (You already set the column to be displayed in green in the default settings above)


    Save these rules




    Best Regards,
    Sven

4 Replies

  • iamsarah's avatar
    iamsarah
    Brass Contributor

    Chonski950 

    you can start by right clicking on Column1 and Format this column:

     

    and then Format view as you'd like to have apply the format on rows:

    Add rule and specify the first condition: if column1=00000

    then add another rule for the column 9/10/... empty

    and another one for the 3rd condition

    for checking Colum 9/10 with empty, you may need to go advance mode and edit the Json file. here i have two rules and I just checked for column9 and 10. 

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
      "additionalRowClass": {
        "operator": ":",
        "operands": [
          {
            "operator": "==",
            "operands": [
              "[$Column1]",
              "00000000"
            ]
          },
          "sp-css-backgroundColor-BgCoral sp-css-color-CoralFont",
          {
            "operator": ":",
            "operands": [
              {
                "operator": "||",
                "operands": [
                  {
                    "operator": "==",
                    "operands": [
                      "[$Column9]",
                      ""
                    ]
                  },
                  {
                    "operator": "==",
                    "operands": [
                      "[$Column10]",
                      ""
                    ]
                  }
                ]
              },
              "sp-css-backgroundColor-BgGold sp-css-color-GoldFont",
              ""
            ]
          }
        ]
      }
    }

    result:

    once you switch to Advance mode you cannot switch to design.

     

    If my response helped you, please Like and Mark as Best Response

  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    HI Chonski950 

     

    this is conditional row formatting.
    Go to your list in SharePoint and select "All Items"->Format current view

    select "Conditional Formatting"



    Now set the set the formatting for  "Show all values as" to green as a default.

    Now click "Add a Rule"

    and select the rule and Formattig you want to apply


    You can add multiple rules like

    if column 1 is equal to "00000000" then red

    if column 9 is equal to "" (nothing, just leave empty) then orange
    if column 10 is equal to "" (nothing, just leave empty) then orange
    if column 11 is equal to "" (nothing, just leave empty) then orange
    if column 13 is equal to "" (nothing, just leave empty) then orange
    (You already set the column to be displayed in green in the default settings above)


    Save these rules




    Best Regards,
    Sven

    • Chonski950's avatar
      Chonski950
      Copper Contributor
      Many thanks! It worked! Hadn't thought it would be so easy :).
      Cheers

Resources