Formula to colorize the font of whatever text appears in one field if another field is blank.

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

Sorry I am not very well versed in formulas, I feel like this is very simple bit I can only find information pertaining to formula-date/duration fields. 

Thank you.

Photo of Amanda

Amanda

  • 10 Points

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
You will need to have a new formula text field with HTML enabled.  There is a checkbox for that in field properties.

IF(Trim([my other field])="", "font color=red> & [My field I want colorized]).

In that formula above, I am assuming that it is a text field type which you want colorized.
Photo of Amanda

Amanda

  • 10 Points
I copied your formula above and replaced it with this: IF(Trim([Employee Name])="", "font color=red> &[Temp Employee]) and I am getting syntax errors.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
Sorry, try this. I was missing a closing quote "

 IF(Trim([Employee Name])="", "font color=red>" &[Temp Employee])
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
sorry one more correction


 IF(Trim([Employee Name])="", "<font color=red>" &[Temp Employee])
Photo of Amanda

Amanda

  • 10 Points
Ok, first.. thank you for your patience.. At first the formula did not work.. but I was not getting syntax.. then I changed the formula to this:
If(Trim([Employee Name])="", "<font color=red> &[Temp Employee]")  The color works here... but it is not giving me the value from the Temp Employee field, it is just displaying "&Temp Employee" is red...
Is it something I have to do with the varText thing?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
Let work on why this is not working. what error are you getting with this formula.  What does the error message say?

IF(Trim([Employee Name])="", "<font color=red>" &[Temp Employee])
Photo of Amanda

Amanda

  • 10 Points
ok for some reason when I copied/pasted that time it worked! Thank you!
Photo of Amanda

Amanda

  • 10 Points
One other question ...what exactly does "trim" specify?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
Well, it was possible that the [employee name] field was just some spaces (even 1 space) which you can't actually see.  So I was just covering that off by using Trim, which trims off any leading or trailing spaces.  

it could be just done as

IF([Employee Name]="", "<font color=red>" &[Temp Employee])

which would read simpler, but if the employee name was just a space then it would end up blank.

By the way, what do you want to happen is the [Employee name] field is not blank.  Right now it will be blank. Maybe that is what you want.
Photo of Amanda

Amanda

  • 10 Points
Yes, I think I want it to be blank! I hope...