thumbnail image formula

  • 0
  • 2
  • Question
  • Updated 2 years ago
  • Answered
So I have a field that shows a thumbnail preview of all images in 1 field.  However sometimes not all fields contain images, so quickbase leaves a blank, placeholder for it.  Is there any way I can alter this formula to not show the image if the attachment field is blank.  Im thinking an IsNull formula?

Also, is there any way of displaying the thumbnail, but clicking on it will open up the full size image?

Here is my formula:


"<img width=\"250\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e31/v0\" /> <img width=\"250\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e32/v0\" /><img width=\"250\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e33/v0\" />"

Photo of Geoffrey

Geoffrey

  • 1,730 Points 1k badge 2x thumb

Posted 2 years ago

  • 0
  • 2
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Put an IF statement on each of those formulas. Combined with a List function.
So if the file is blank, it shows nothing, otherwise it used the image.

List(" ",
If([File Attachment Field 1]="", "", "<img width=\"250\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e31/v0\" />"),
If([File Attachment Field 2]="", "", "<img width=\"250\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e32/v0\" />"),
If([File Attachment Field 3]="", "", "<img width=\"250\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e33/v0\" />")
)
Photo of Geoffrey

Geoffrey

  • 1,730 Points 1k badge 2x thumb
That worked nicely.  Thanks.  Is there any way of linking from the thumbnail to the original image?
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb

List(" ",

If([File Attachment Field 1]="","","<a href='"&URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e33/v0/" & [File Attachment field 1]&"'><img src="&URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e33/v0/" & [File Attachment field 1]&" width='120px' /></a>".....

(Edited)