How do I display an image in one of three attachment fields (whichever one has a file attached and if multiple fields have attachments, only display one)?

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

I have three file attachment fields (FIDs 57, 58 and 59) where users can attach an image file.

In another field, I want to display the image in FID 58 if one exists.

If not, I want to display the image in FID 57 if one exists.

If not, I want to display the image in FID 59.

How would I write the formula for this? Thank you in advance!

Photo of Karen

Karen

  • 222 Points 100 badge 2x thumb

Posted 4 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 65,096 Points 50k badge 2x thumb
Not tested but try this

if(

[File attachment 1]<>"","<img src=" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e57v0' width='300' >",

[File attachment 2]<>"","<img src=" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e58v0' width='300' >",

[File attachment 1]<>"","<img src=" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e59v0' width='300' >")

Assuming that works then play with the 300 value to size the pix.


Photo of Karen

Karen

  • 222 Points 100 badge 2x thumb
Worked great!! Many, many thanks!