Apply conditional Colors to cells (colour if you're from the UK.!) 

Apply conditional Colors to cells (colour if you're from the UK.!) 

  
Hi All,
I've read a few posts on this subject, but I'm still struggling.
I want to apply a colour to a cell depending on a status - Green if its 'Ready', Orange if it's 'WIP' and RED if it's 'Not Ready'

So far I'm using this below that colors Red for anything other than 'Ready', what is the syntax of the line below to have the options above?
If (GetPropertyReadiness.List.Current.PropertyReadiness__Status.Label
<> "Ready","background-color:red","")
Thanks in Advance

Gary
Hello Gary,

i assume that you are setting that in the extended properties (style) of the cell.

but if you are doing that on a table or list records, you sould change
GetPropertyReadiness.List
to the table/list instead of the query that is populating it.

is that it?

regards,
Miguel Antunes
Hi Gary,

I would sugest that you implement an action, that could be used as a function.
It would receive as input parameter a PropertyReadinessStatusId, and would output a string containing the colour.

Inside the action you could use a switch to choose the colour.

This way you could:
  • abstract from using the label attribute. You could any time change the label, and your function would still work
  • return any string that could be used as argument for 'background-color'
  • you can easily extend your code to handle new status if needed

Let me know if you need further help :)
You could add a Color atrribute to PropertyReadiness_Status. Then the style could look like this:

"background-color: " + GetPropertyReadiness.List.Current.PropertyReadiness__Status.Color
RESOLVED - It's been a while since I posted this, but looking for something else in the forum I found exactly what I was looking for.
I wanted to colour one cell based on 3 options, and here's what worked for me:
If (GetPropertyReadiness.List.Current.PropertyReadiness__Status.Label = "Not Ready","background-color:Red",
If (GetPropertyReadiness.List.Current.PropertyReadiness__Status.Label = "Ready","background-color:Green","background-color:Orange;"))