Forum Discussion

GZRService_Acco's avatar
GZRService_Acco
Qrew Trainee
22 days ago
Solved

Document Template - Images

Good Afternoon, How do I get an image to display in a document template?  Right now all I'm getting is the file name in text.  Please see attachments for current document template set up and result...
  • Denin's avatar
    22 days ago

    Create a new rich text formula field. Then use this formula:

    //Where it says e50, change the 50 to your attachment field ID
    var text url = URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e50/v0";
    
    //Change to your file attachment field
    var text img = If(
        [File Attachement] <> "",
        "<img src='" & $url & "' />\n",
        ""
    );
    
    $img

    Make the minor changes per the comments in the formula. Now use the formula in the document template instead of the file attachment field directly. If you need to customize height/width of image, it can be done too by editing the HTML in the formula.