Adding HTML Color

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

The below formula errors with the result - -

Please check the syntax od your entire formula. Possible culprits are a mismatched set of parentheses, missing quotes, or an extra bracket.

Here is the formula....what am I missing!

if(isnull([LM: Job Type (1)]),"1",
[LM: Job Type (1)]="Time Off","<div style="background-color: #ff9999;">Time Off</div>")

Photo of Joshua

Joshua

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of Joshua

Joshua

  • 0 Points
The foundation for the data was taken from the below quickbase help link.  

http://quickbase.intuit.com/developer/knowledge-base/can-i-color-records-calendar-report
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,760 Points 50k badge 2x thumb
The syntax example is here. You will need backslashes before those quotes inside the div style

http://www.quickbase.com/user-assistance/Default.html#color_field.html

Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,074 Points 20k badge 2x thumb
MS>You will need backslashes

Backslashes are only going to make the formula harder to read:

Use single quotes on the style attribute:

"<div style='background-color: #ff9999;'>Time Off</div>"

Or use no quotes at all on the style attribute (but remove the extra space):

"<div style=background-color:#ff9999;>Time Off</div>"

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,760 Points 50k badge 2x thumb
Thx Dan!