Formula Help

  • 0
  • 1
  • Question
  • Updated 10 months ago
  • Answered
I'm attempting to create a series of colorized progress trackers, based on a number of requirements.  To do so, I'm trying to colorize a field based on a number of checkboxes.  

Example:

I have different types of contacts that I need my sales folks to ensure we have in place prior to moving a deal forward.  What I would like is for the status bar on the main page to change color based on having none of the boxes checked (Red), any one of the boxes checked (Orange), and two boxes checked (Yellow) and all boxes checked (Green).

Thoughts?

Mike
Photo of Mike

Mike

  • 554 Points 500 badge 2x thumb
  • confused

Posted 10 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
There are 502 icons here available for public use in 5 convenient sizes.

https://login.quickbase.com/db/9kaw8phg?a=ShowPage&pageid=134

https://login.quickbase.com/db/bcgnn27bx?a=q&qid=1000039

var number NumCompleted =
Count( [checkbox 1], [checkbox 2],[checkbox 3]);

Case($Count,
0, "<img src=https://images.quickbase.com/si/32/221-point_red.png>",
1, "<img src=https://images.quickbase.com/si/32/223-point_yellow.png>",
2, "<img src=https://images.quickbase.com/si/16/224-point_blue.png>",
3, "<img src=https://images.quickbase.com/si/32/222-point_green.png>")
Photo of Mike

Mike

  • 554 Points 500 badge 2x thumb
Ok, So I probably should've started with, I kinda suck at formulas.  I've put what you showed above into my field, changed the "[checkbox 1] to the actual name of the field, and I'm getting the following error.  
Sorry to be a hassle.

Mike

*NOTE*
I'm going to need to replicate this across a couple of different tables that are not only related to contacts.

--------------------------------------------------------------------------------------------------------------------------------------

var number NumCompleted = Count([Buyer], [Decision Maker],[Influencer]);Case($Count,0, "<img src=https://images.quickbase.com/si/32/221-point_red.png>";, 1, "<img src=https://images.quickbase.com/si/32/223-point_yellow.png>";, 2, "<img src=https://images.quickbase.com/si/16/224-point_blue.png>";, 3, "<img src=https://images.quickbase.com/si/32/222-point_green.png>")

Error message:

Formula Error--Undeclared Identifier
The variable Count is not declared
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
No problem, there was a clear error in my formula
Change that first part to this

var number Count NumCompleted = 
Count( [checkbox 1], [checkbox 2],[checkbox 3]);
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Sorry my mistake
Chance the first line to this

var number Count  = Count([Buyer], [Decision Maker],[Influencer]);
Photo of Mike

Mike

  • 554 Points 500 badge 2x thumb
Perfect.  Now we're getting somewhere.  However, the record only displays the URL as opposed to the icon.
Thoughts?

Mike
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
The field type is probably Formula text.
Can you carefully change it to formula Rich text.  make sure you choose formula Rich text and not Rich Text.
Photo of Mike

Mike

  • 554 Points 500 badge 2x thumb
And now I feel like an idiot.  Lol.  
Thanks for all the help on this.  I owe you a drink at Empower.

Mike
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
:) I will be there ....  That field type is a new thing. it used to be a checkbox to enable html on a regular  formula field, but that changed in the December release to a separate field type.