SOLVED

Conditional formating rows in sharepoint list based on values

Copper Contributor

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

4 Replies
best response confirmed by Chonski950 (Copper Contributor)
Solution

HI @Chonski950 

 

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

list2.png

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

Now click "Add a Rule"
list3.png
and select the rule and Formattig you want to apply

SvenSieverding_0-1677771641568.png


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 

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

sarah___0-1677771566328.png

 

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

sarah___1-1677771637458.png

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

sarah___2-1677771772275.png

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:

sarah___3-1677772153286.png

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

 

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

Many thanks! It worked! Hadn't thought it would be so easy :).
Cheers
1 best response

Accepted Solutions
best response confirmed by Chonski950 (Copper Contributor)
Solution

HI @Chonski950 

 

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

list2.png

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

Now click "Add a Rule"
list3.png
and select the rule and Formattig you want to apply

SvenSieverding_0-1677771641568.png


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

View solution in original post