Discussions

Expand all | Collapse all

Photo Not Displaying in Record (form)

  • 1.  Photo Not Displaying in Record (form)

    Posted 04-06-2017 18:32
    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!


  • 2.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 18:38
    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.


  • 3.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 19:00
    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.


  • 4.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 19:47
    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\" />"


  • 5.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 20:10
    Thanks!


  • 6.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 18:39
    Are you viewing or editing the record?  A link will display in edit, and the picture should show when viewing.


  • 7.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 18:58
    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!


  • 8.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 19:02
    The method shown below will show the picture in edit or view mode..
    Neil


  • 9.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 18:51
    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


  • 10.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 19:00
    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.


  • 11.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 19:03
    I think our messages crossed.  The method above works in both modes.  I just tested it on our system.
    Neil


  • 12.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 19:26
    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:

    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1578843/RackMultipart20170406-102527-1oaczex-Capture_inline.JPG?1491506734">


    Thanks for you patience!


  • 13.  RE: Photo Not Displaying in Record (form)

    Posted 04-06-2017 21:14
    You want to display the second formula field - the first one is just a link to the file attachment field.  The 6 is the field id of the file attachment field.  On our system 6 is the field id of the field labeled  [employee image]. 
    If you paste your two formula fields in your response I'll check them for syntax.
    Neil