Forum Discussion

AaronZielinski's avatar
AaronZielinski
Qrew Cadet
8 years ago

Photo Not Displaying in Record (form)

I am uploading a single photo to a form (record) as a file attachment.  I have chosen to option to display the image (.jpg, .png) on the form, but it is not displaying.  It is showing the file name which is clickable to view the photo.  I would like the photo to display on the page though so the employee's picture shows with the rest of his record.  Help!

12 Replies

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    Create a new field, Formula-Text, and call it something like "Image"

    Insert this formula with a few modifications:

    If([Picture File]="","","<img height=\"80\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e41/v0\" />")

    The changes you will need to make are the "e41", change that to the field id of your file attachment field...
    "eXX"
    I put a conditional If statement to make it blank if the file is empty, so change the field [Picture File] to your file attachment field.
    You can also control the size/height of the image

    Let us know if you get stuck.
    • AaronZielinski's avatar
      AaronZielinski
      Qrew Cadet
      Thanks Matthew.  Based upon John's response, it appears that it's there but only displaying in "view" mode vice "edit" mode.  I'm hoping to see it regardless of mode since we mostly work in "edit" mode.
    • MCFNeil's avatar
      MCFNeil
      Qrew Captain
      This method is one field and works in edit, view and reports.  

      I'd recommend not sizing the image for height & width, as this could distort your original.

      Make sure the "Enable HTML" checkbox just above the formula entry box is checked to display the image.

      "<img height=\"80\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e41/v0\" />"
  • Are you viewing or editing the record?  A link will display in edit, and the picture should show when viewing.
    • AaronZielinski's avatar
      AaronZielinski
      Qrew Cadet
      Now that you mention it, I was viewing it in "edit".  I see the picture in "viewing".  Is there a way to view the picture in "edit" as that's where we do most of our actual work?  Thanks!
    • NeilServices's avatar
      NeilServices
      Qrew Member
      The method shown below will show the picture in edit or view mode..
      Neil
  • You can do this with two formula fields:
    First create a formula text field with with this formula: 
    "https://www.quickbase.com/up/";   & Dbid () 
      & "/a/r" 
      & [Record ID#] 
      & "/e6/v0?"
      & [employee image]

    [employee image] is the file attachment field
    Replace https://www.quickbase.com  with your domain name.
    The 6 in e6 is the fid of the file attachment field

    Then to display the image - create a second field 
    This is also a formula text field with the allow some html box checked
    "<img src=\""         
             &[image href]
             & " height=\"75\""
             & " width=\"75\""
             & "\"/>"

    Where [image ref] is the first formula field
    Good luck
    Neil
    • AaronZielinski's avatar
      AaronZielinski
      Qrew Cadet
      Thanks Neil.  Based upon John's response, it appears that it's there but only displaying in "view" mode vice "edit" mode.  I'm hoping to see it regardless of mode since we mostly work in "edit" mode.
    • NeilServices's avatar
      NeilServices
      Qrew Member
      I think our messages crossed.  The method above works in both modes.  I just tested it on our system.
      Neil
    • AaronZielinski's avatar
      AaronZielinski
      Qrew Cadet
      I think I'm messing up somewhere.  The first formula is showing up on the edit page and a generic thumbnail directly below it.  A few questions:

      1.  Do I need to take out or leave in the spaces in the second formula (the ones going from line to line)?
      2. The "6" in the second formula.  Is that the # of the Form Element of the first text formula we created?

      Here is a snapshot below that is showing up:




      Thanks for you patience!