Skip to main content
January 11, 2025
Question

Preview Word Document using DocumentViewer

  • January 11, 2025
  • 4 replies
  • 1 view

Is it possible to show the Word document using documentViewerField.

current behavior- When we click on the tab to display document, its downloading directly

Expected behavior- The document should be visible for like PDF and downloadable.

4 replies

March 20, 2025

Hi [mention:ca3b61807f6649dca7de0fbed6feb09f:e9ed411860ed4f2ba0265705b8793d05] ,

It is not possible to show the word document using the documentViewerField().
I would suggest instead of hard coding the value for the document it should be fetch within the local variable and then use the documentViewerField to display it but it won't work with Docx file. Please refer the code below:

a!documentViewerField(
  label: document(
    documentId: cons!MY_PDF,
    property: "name"
  ),
  document: cons!MY_PDF
)

varuntejg243705
March 20, 2025

Hi [mention:ca3b61807f6649dca7de0fbed6feb09f:e9ed411860ed4f2ba0265705b8793d05] ,

Using documentViewerField() we can't view Word Documents, i only supports few file extensions.

Instead you can convert them into PDF and make it viewable using Document Viewer, add a document download link button contains docx link on top of the field.

Hope this is the only way, we also dont have a certain custom plugin to view on interface too.

mikes0011
Brainy
March 20, 2025

FYI there's a (paid) plug-in that allows Office files (at least some types, including Word) to be viewed natively on-form.  I've tried the free preview before and it works pretty decently, with a range of advanced (though also tricky) configurations available.  I'm not sure what the paid cost is.

community.appian.com/.../apryse-webviewer-component-plug_2d00_in

March 20, 2025

The way you can display a docx file inline would be to store it in Sharepoint and use the webContentField with the sharepoint URL.