Need help with a formula?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a field called "product code" and a formula field called "product code requested". I want if the "product code" field is blank/empty to display a red circle in the "product code requested" formula field.  If the "product code" field does have a value listed I want a green circle to show in the "product code requested" formula field. I tried this formula but no luck:

Case ([Product Code],"false","","true",">https://images.quickbase.com/si/16/221-point_red.png\">","true","https://images.quickbase.com/si/16/222-point_green.png\">",null)


Any ideas?
Photo of Derek

Derek

  • 20 Points

Posted 3 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
if(trim([Product Code])="", 

"<i m g   src=https://images.quickbase.com/si/16/221-point_red.png>",

"<i m g src = https://images.quickbase.com/si/16/222-point_green.png>")


in the above formula change the i m g to img  (take out the spaces).  I had to add spaces or else this forum software gets confused.
Photo of Derek

Derek

  • 20 Points
Perfect thanks works
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
:)
Photo of Derek

Derek

  • 20 Points
Hi one more question if you don't mind.  I have field called “code Status” and another formula field called “QA Status” that I want to do similar to my question above.  Do you see anything wrong with this formula?

Case ([Code Status],"In Test","<div><img src=\"https://images.quickbase.com/si/16/222-point_green.png\"></div>",
"Conditionally Verified","<div><img src=\"https://images.quickbase.com/si/16/222-point_greem.png\"></div>", "In Developement","https://images.quickbase.com/si/16/221-point_red.png\"></div>", null)
Photo of Derek

Derek

  • 20 Points
other than me misspelling green in one of the links
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
is your formula not working?


i would do it like this

Case ([Code Status],
"In Test","<img src=https://images.quickbase.com/si/16/222-point_green.png>",
"Conditionally Verified","<img src=https://images.quickbase.com/si/16/222-point_green.png>",
"In Development","<img src=https://images.quickbase.com/si/16/221-point_red.png>")

I changed the spelling of In Development.
Photo of Derek

Derek

  • 20 Points
It's not working and I don't know why any other ideas?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
Can you post your formula and explain what about it is not working?
Photo of Derek

Derek

  • 20 Points
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
Is there a syntax error and if so can you post the error?
Photo of Derek

Derek

  • 20 Points
I don't receive any error when saving
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
OK, so what is the problem when you say "it does not work".  Did you check the box to allow some HTML?
Photo of Derek

Derek

  • 20 Points
Yeah that box is checked.  I ended up figuring it out, the status' are case sensitive so instead of putting it as "In Test" it should have been "IN TEST".
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
Great!