How do you highlight a field based on text value?

  • 0
  • 2
  • Question
  • Updated 1 year ago
  • Answered
I have a table with requests for an Audit. I have a column with QB Status as the title and the field either says Open, In Progress, or Closed. 

I want Open to be highlighted in a light green, In Progress to be highlighted in a light yellow, and Closed to be highlighted in a light red. I have tried some formulas but I am very new to QB so I have not had much experience with syntax errors. 

Here is an example of a formula I tried:

If([QB Status]="Open", "<div style=\"background-color:green;\"> Open</div>", [QB Status] )

Can someone please help me with a formula? Thanks!
Photo of Diana Ciccolini

Diana Ciccolini

  • 100 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 2
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb

See if you like this a little better:

If([qb status]="Open", "<div style=\"width:70px;padding:3px;background-color:green;color:white\"> Open</div>", [qb status] )


Photo of Diana Ciccolini

Diana Ciccolini

  • 100 Points 100 badge 2x thumb
I'm still not seeing any change, but I didn't get any syntax errors. 

I am currently in my Report Settings and I clicked Highlight Records based on criteria and inputted that formula.

Should I be doing this on a different page? 
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb
OOHH, I made a formula field. I had assumed you were on a form.
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb

In the report settings, use this syntax for highlighting a row:

if ([Priority] = "High", "pink", "")
You can use hex code for color if you want to, "#cc66cc", etc.

(Edited)
Photo of Diana Ciccolini

Diana Ciccolini

  • 100 Points 100 badge 2x thumb
Looks like I am in the wrong, then. I want to only highlight the "QB Status" field in the report, not the entire row. Where do I input a formula in the form settings?
(Edited)
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb

So click on the table tab where you want to create a new field. Then click "Settings" at the far left underneath the table name.

On the next page, select "Fields".

On the Fields page, click the green button, "+New Fields"

You want to create a formula text field.

Paste in the code provided, check box the option to allow HTML.

Click SAVE.

Insert your new field into the report.

HTML will not export to csv.