Skip to main content
Question

Color Coding Fields

  • October 31, 2022
  • 0 replies
  • 203 views

I am trying to make a report that color codes the individual fields based on a given specification range. For example, the one I'm starting with I want to highlight the field in red when the number is greater than 1.50. I tried looking through the community tab to see where in the coding I went wrong but I wasn't having any luck. For some reason, the code is functioning properly in terms of the highlighting, but isn't pulling the number over correctly. Here is the code that I have set up in the Formula Rich Field (I've also attached an image):

If([Lot Sensory Score:] > 1.5, "<div style=\"background-color:red;\">[Lot Sensory Score:]\n</div>", ToText([Lot Sensory Score:]))

For some reason the second "[Lot Sensory Score]" isn't pulling correctly and isn't turning green in the code window.

Eventually, I want to get more complicated with the color coding fields (i.e. if this field is A, color based on 80-100; if this field is B...), but I was trying to start simple.

------------------------------
Paige M.
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
Try this
If([Lot Sensory Score:] > 1.5,
"<div style=background-color:red>" & ToText([Lot Sensory Score:]) & "</div>",
ToText([Lot Sensory Score:]))

 if you want to have more complex colors you can do this.

If(
[Lot Sensory Score:] > 1.5,
"<div style=background-color:red>" & ToText([Lot Sensory Score:]) & "</div>",

[Lot Sensory Score:] > 1.2,
"<div style=background-color:Blue>" & ToText([Lot Sensory Score:]) & "</div>",

[Lot Sensory Score:] > 1.0,
"<div style=background-color:yellow>" & ToText([Lot Sensory Score:]) & "</div>",

ToText([Lot Sensory Score:]))

There is also complete set of hex color codes here https://laurahillier.quickbase.com/db/bhy8pumuk?a=q&qid=-1000003&dr=1 which you can use instead of the color names in words.


------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------