Forum Discussion

xeno85's avatar
xeno85
Copper Contributor
Nov 15, 2021
Solved

Configure conditional formatting for SharePoint list gallery view

Hey there, I am trying to configure conditional formatting on the tiles based on specific values. I am trying to create a traffic light system for the cards based on priority so that the background ...
  • xeno85's avatar
    Nov 16, 2021

    Hey everyone,

    I've resolved this thanks to https://twitter.com/techan_k/status/1457664410042785802 on Twitter!

     

    Just writing out the solution on here as well so it's easy to follow for anyone else.

     

    From the class section, delete the ms-bgcolour value but keep the rest of the values as that gives the card its look and feel!

    Add the following style value in between elmType and attribute section. I've included the code below to make it easier to copy and paste in. Decide on the colours you would like! Add additional if values if more than two are required. The last hex colour code is an else colour if your values don't match any of your if statements.

     

    "style": {
              "background-color": "=if ([$ColumnName] == 'Nintex' , '#F5F9FD' , if ([$ColumnName] == 'Oracle' , '#EBF9EC' , '#FFF1EF'))"
            },

     

     

Resources