Skip to main content
May 9, 2022
Question

Display an HTML Document on Interface

  • May 9, 2022
  • 6 replies
  • 2 views

Hello, 

I would like to display an HTML document in an Appian Interface. I don't want to download the document but instead I want to be able to just show it.

I've tried using a couple of components like "DocumentViewerField and WebContentField". However, both have problems.

WebContentField throws an error if the content is from the same domain

DocumentViewerField does not display the HTML

What is another way to do this?

Basically, my use case is to display the HTML document and be able to click on a button link to an external application.

Regards,

Le

    6 replies

    stefanhelzle0001
    Brainy
    May 9, 2022

    This is not supported OOTB. Can you extract the button URL and provide a Appian UI link to that external website?

    manishk0011
    May 9, 2022

    Hi,

    Try WebContentField by adding /embed in the URL  some thing like this -> https://www.youtube.com/embed/dQw4w9WgXcQ

    a!webContentField(
    source: "https://www.youtube.com/.../dQw4w9WgXcQ",
    altText: "Example Domain",
    height: "MEDIUM",
    showBorder: true
    )

    Inspiring
    May 9, 2022

    This is not supported in Appian out of the box, provide a link in Appina UI to take user to external Application.

    joshf713
    May 9, 2022

    Yea Appian does not let us use the web content field to show things hosted inside of Appian. You are also correct in stating the doc viewer does not support HTML. 

    This may be going out on a limb a bit, but maybe you could create your html document then convert it to pdf. I don't know if the pdf would maintain the links. 

    Other than that the simplest route may be what [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] mentioned. Just make a link in the appian UI. 

    mikes0011
    Brainy
    May 9, 2022

    The way I've handled this before:

    1) create a temporary PDF copy of the HTML file  (note: the HTML will be flattened and will be purely "read-only" in functionality.  it MIGHT still allow clickable hyperlinks, but you'd have to try it to be sure)

    2) display the PDF file using the standard Document Viewer Field.

    You can create a PDF of an HTML file using, among other things, the PDF from HTML smart service in the Dynamic Document Generator plug-in.  The main caveat here is that the resulting PDF might vary in quality depending on the HTML file it's fed.  But I've used this technique to some degree of success at least once in the past.

    Honestly though if your primary use case is to provide the user a link to an external URL, just use an a!safeLink() for that.  Stuff shown in the Document Viewer Field should be assumed as non-interactive IMHO.

    The Expression Guru
    May 9, 2022

    Mike, thanks.