Formula to show status based on color

  • 1
  • 2
  • Question
  • Updated 1 year 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 ww.quickbase.com/up/bcgnn27bx/g/rdc/eh/va/221-point_red.png>")
Photo of Cecelia

Cecelia

  • 50 Points

Posted 1 year ago

  • 1
  • 2
Photo of Michael Barrow

Michael Barrow

  • 2,206 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:

If([IsAssignedToInactiveEmployee?],
"<div><img src=\"https://images.quickbase.com/si/16/282-user_delete.png\"></div>";,
"<div><img src=\"https://images.quickbase.com/si/16/280-user_0.png\"></div>";
)