Forum Discussion

KarenHenke's avatar
KarenHenke
Qrew Cadet
5 years ago

Display a .jpg attachment as an image in a notification

Hello, I know this has been asked before (in 2018) but the suggestions offered don't seem to work for me.

I have an image attachment field that I'd like to add to an email notification displayed as an image (not as a link to the image or the file name).

Thank you in advance for any guidance,
~k


------------------------------
Karen Henke
------------------------------
  • You can try this as a Rich text formula field,

    var text FileType = Right(ToText([My file attachment field]),".");

    If(Contains("jpg, jpeg, png",$FileType),
    "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e282/v0' width='75' >")

    Where 282 would be replaced with the field ID of the file attachment field.

    Note that the user will need to have access to the images without logging in.  I suggest checking the box on the file attachment field to allow access without logging in.


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • KarenHenke's avatar
      KarenHenke
      Qrew Cadet
      Worked perfectly, thanks Mark!

      ------------------------------
      Karen Henke
      ------------------------------
    • KatherineOakey's avatar
      KatherineOakey
      Qrew Member
      This is the problem I'm currently working on.

      var text FileType = Right(ToText([My file attachment field]),".");

      If(Contains("jpg, jpeg, png",$FileType),
      "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e282/v0' width='75' >")

      [My file attachment field]   I assume is the field in the table that has the actual image.  Currently, my desired logo image is in a child table of the table the notification is being used on.   I want to use the same logo image for every notification that is sent.



      Using just the <img src=     &displays the URL - yes, I can go to a browser, paste the URL in and it displays.

      I have the pixel sizing for the image and I want to resize it smaller.  If I specify only a width, will the height be calculated on the aspect of the image?

      This is what I currently have and still a URL and not the image itself.

      var text FileType = Right(ToText([Images:Image]),".");

      If(Contains("jpg, jpeg, png",$FileType),
      "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & 24 & "/e6/v0' width='75' >")

      & 24 is the Record Id of the actual image
      e6 is the field ID for the Image field

      ------------------------------
      Katherine Oakey
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        The field type should be set to formula Rich text.
        Make sure you check the box in the file attachment field 

        "Allow access to this file attachment from a Quickbase link without signing in"

        You can set either the Width or change the parameter to Height,  and it will properly scale.  But do not set both or it will get skewed and distorted.

        Then it should work.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------