Skip to main content
New Participant
Jan 11, 2025 4:26 AM UTC
Question

Preview Word Document using DocumentViewer

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

kapils024874
Inspiring
Mar 20, 2025 10:11 AM UTC

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
Inspiring
Mar 20, 2025 11:56 AM UTC

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
Mar 20, 2025 12:13 PM UTC

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

The Expression Guru
Participating Frequently
Mar 20, 2025 12:27 PM UTC

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