Forum Discussion

AudreyBenenati's avatar
AudreyBenenati
Qrew Cadet
5 years ago

Coloring a field


Hi, a few years ago, I built a bunch of formula fields that would display the text of another field with various colored backgrounds, using a Case() formula in a rich text formula field.

For the last year or so, I'm with a new company and can't get it to work no matter what. It works for the 2nd condition but not the first. I've tried changing it to If(), changing the colors, with and without the last "", and on and on.

Looking for suggestions! Thx

Case([Overall compliance status], "Fully compliant","<div style='background-color:#9EFFAF;'"&[Overall compliance status]&"</div>",

[Overall compliance status], "Not fully compliant","<div style='background-color:yellow;'"&[Overall compliance status]&"</div>",
"")

2 Replies

  • You don't need to repeat the reference to your field in the Case(). Just at the very beginning and then check for expected responses

    Case([Overall compliance status], 

    "Fully compliant","<div style='background-color:#9EFFAF;'"&[Overall compliance status]&"</div>",

    "Not fully compliant","<div style='background-color:yellow;'"&[Overall compliance status]&"</div>",

    "")


    Chayce Duncan | Director of Strategic Solutions
    (720) 739-1406 | chayceduncan@quandarycg.com
    Quandary Knowledge Base
  • You also need to close your <div>'s see bold and underlined > closures below:


    Case([Overall compliance status],

    "Fully compliant","<div style='background-color:#9EFFAF;'>"&[Overall compliance status]&"</div>",

    "Not fully compliant","<div style='background-color:yellow;'>"&[Overall compliance status]&"</div>",

    "")