Conditional image in exact forms

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

I have images from my public library embedded into my exact forms without any problem. What I'm having trouble with is making the display of those images conditional. Here's an example of code that's not displaying the image (I've replaced x's for some sensitive info but the code is all here):

~=if(field["Print Signature?"]=="Yes";){"<img width=198 height=39 src='https://xxxxxxxxx.quickbase.com/up/xxxxxxxxx/g/r3/ej/va/sig.jpg' alt='https://xxxxxxxxx.quickbase.com/up/xxxxxxxxx/g/r3/ej/va/sig.jpg'>"};;~

Is there any way to make this work?


Photo of Mark

Mark

  • 40 Points

Posted 4 years ago

  • 0
  • 1
Photo of Keith

Keith, Champion

  • 1,320 Points 1k badge 2x thumb
Hi Mark,

I like to keep logic in tables/fields and not in exact form templates. You can create a new field on your table of type formula text with html checked.

Then use this code in that field:

if([Print Signature?]="Yes","<img src=\"https://xxxxxxxxx.quickbase.com/up/xxxxxxxxx/g/r3/ej/va/sig.jpg\">","")

Then reference this new field in the template(assuming the new field id is 99)

~99~

Keith
Photo of Mark

Mark

  • 40 Points
Thank you.  I don't know why I didn't think of that.