Coloring a field

  • 2
  • 1
  • Question
  • Updated 1 month ago
  • In Progress


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>",
"")

Photo of Audrey Benenati

Audrey Benenati

  • 92 Points 75 badge 2x thumb

Posted 1 month ago

  • 2
  • 1
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
Photo of Adam Keever

Adam Keever

  • 2,430 Points 2k badge 2x thumb

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>",

"")
(Edited)