Formula to show status based on color

  • 1
  • 2
  • Question
  • Updated 2 years ago
  • Answered
I would like to have a text formula field show a button color based on status.  So if Status=Bad, I would like to have a button show RED.  I tried this but it didn't work....

If( [Status]="Bad",
"<i m g s r c=h ttps://w>")
Photo of Cecelia


  • 200 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
  • 2
Photo of Michael Barrow

Michael Barrow

  • 2,216 Points 2k badge 2x thumb
Here's a similar formula I have in my application:

Case([Activity Status], 
"1 Not Started", "<div style=\"background-color:bisque;width:40\">1 Not Started</div>",
"2 Ready", "<div style=\"background-color:yellow;width:40\">2 Ready</div>",
"2 Active", "<div style=\"background-color:yellow;width:40\">2 Active</div>",
"3 Needs Review", "<div style=\"background-color:orange;width:40\">3 Needs Review</div>",
"3 Open Workflow", "<div style=\"background-color:yellow;width:40\">3 Open Workflow</div>",
"4 On Hold", "<div style=\"background-color:orchid;width:40\">4 On Hold</div>",
"5 Deferred", "<div style=\"background-color:deepskyblue;width:40\">5 Deferred</div>",
"6 Completed", "<div style=\"background-color:Chartreuse;width:40\">6 Completed</div>",
"<Unknown Status>", "<div style=\"background-color:red;width:40\"><Unknown Status></div>"

And here's a different one where I use images:

"<div><img src=\"\"></div>";,
"<div><img src=\"\"></div>";